Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-111178: Change Argument Clinic signature for METH_O #130682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 11, 2025

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Feb 28, 2025

Use "PyObject*" for METH_O functions to fix an undefined behavior.

@vstinner
Copy link
Member Author

@erlend-aasland: Would you mind to review this change? Focus on the first and third commit, the second one only updates generated code.

This change is a follow-up of PR #128447 (commit 537296c).

Example with list_append() signature:

  • Before: list_append(PyListObject *self, PyObject *object)
  • After: list_append(PyObject *self, PyObject *object)

which is the correct signature for methods: typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);.

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manual modifications look correct to me but for the AC part I don't know if there are more assumptions I'm not aware of.

Modules/_io/bufferedio.c Outdated Show resolved Hide resolved
@rhettinger rhettinger removed their request for review March 10, 2025 22:41
@vstinner vstinner merged commit 9d759b6 into python:main Mar 11, 2025
57 checks passed
@vstinner vstinner deleted the clinic_self branch March 11, 2025 15:33
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
…130682)

Use "PyObject*" for METH_O functions to fix an undefined behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.