Make PY_SSIZE_T_CLEAN not mandatory again #104922
Copy link
Copy link
Closed
Labels
Description
Feature or enhancement
Use ssize_t version API regardless PY_SSIZE_T_CLEAN is defined.
No change to ABI.
Pitch
After Python 3.12 become EOL, extension developers can forget about PY_SSIZE_T_CLEAN completely.
Previous discussion
Linked PRs
Reactions are currently unavailable
Activity
[-]Make PY_SSIZE_T_CLEAN not mandatolly again[/-][+]Make PY_SSIZE_T_CLEAN not mandatory again[/+]gh-104922: Make `PY_SSIZE_T_CLEAN` not mandatory again (#105051)
vstinner commentedon Jul 1, 2023
Python stdlib extensions still define the PY_SSIZE_T_CLEAN macro. Is it still useful? It's unclear to me.
Also, the official documentation also requires to define the PY_SSIZE_T_CLEAN macro: https://docs.python.org/dev/extending/extending.html
methane commentedon Jul 1, 2023
See right after the doc. I added the link to https://docs.python.org/dev/c-api/arg.html#arg-parsing-string-and-buffers
And there is a note about it at link target.
I didn't remove the recommendation because user may want to support older Pythons.
I didn't remove them to ease review and avoid conflicts. But I will remove them all.
vstinner commentedon Jul 1, 2023
The (extension) doc should just explain that the macro was needed on Python 3.12 and older.
gh-104922: remove PY_SSIZE_T_CLEAN (#106315)
gh-104922: Doc: add note about PY_SSIZE_T_CLEAN (#106314)
Merge branch 'main' into modulelocals
vstinner commentedon Jan 16, 2024
As a side effect, this change fixed the stable ABI: #71686. Thanks!
Add declarations for private functions from pycore_modsupport
Add declarations for private functions from pycore_modsupport
Add declarations for private functions from pycore_modsupport
Add declarations for private functions from pycore_modsupport
Add declarations for private functions from pycore_modsupport
remove some stuff
Add declarations for private functions from pycore_modsupport
Add declarations for private functions from pycore_modsupport
Add declarations for private functions from pycore_modsupport
Add declarations for private functions from pycore_modsupport
Add declarations for private functions from pycore_modsupport
Add declarations for private functions from pycore_modsupport
Add declarations for private functions from pycore_modsupport
Add declarations for private functions from pycore_modsupport