KEMBAR78
gh-111178: Fix PyCMethod API by vstinner · Pull Request #131135 · python/cpython · GitHub
Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Mar 12, 2025

Replace "size_t nargs" with "Py_ssize_t nargs" in PyCMethod.

Replace "size_t nargs" with "Py_ssize_t nargs" in PyCMethod.
@vstinner
Copy link
Member Author

PyCMethod is documented and the documentation already uses Py_ssize_t: https://docs.python.org/dev/c-api/structures.html#c.PyCMethod

Screenshot 2025-03-12 at 08-31-47 Common Object Structures — Python 3 14 0a5 documentation

@vstinner
Copy link
Member Author

@encukou: Is it ok to change the sign of the nargs parameter in PyCMethod? In practice, Python already calls PyCMethod with signed Py_ssize_t and functions are already implemented with signed Py_ssize_t. Also, as I wrote, the documentation also already uses signed Py_ssize_t.

Copy link
Member

@encukou encukou left a comment

Choose a reason for hiding this comment

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

I believe it is. Thanks!

@encukou encukou merged commit 4dcbe06 into python:main Mar 12, 2025
48 checks passed
@vstinner vstinner deleted the pycmethod branch March 12, 2025 11:18
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
…31135)

Replace "size_t nargs" with "Py_ssize_t nargs" in PyCMethod.
scoder added a commit to cython/cython that referenced this pull request Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants