Skip to content

gh-111178: Fix PyCMethod API - #131135

Merged
encukou merged 1 commit into
python:mainfrom
vstinner:pycmethod
Mar 12, 2025
Merged

encukou merged 1 commit into
python:mainfrom
vstinner:pycmethod

Conversation

@vstinner

@vstinner vstinner commented Mar 12, 2025 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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.

@encukou encukou left a comment

Copy link
Copy Markdown
Member

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
@vstinner
vstinner deleted the pycmethod branch March 12, 2025 11:18
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

2 participants