You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first two lines of our file can be:
#define PY_SSIZE_T_CLEAN
#include <Python.h>
(...)
It is recommended to always define PY_SSIZE_T_CLEAN before including Python.h.
Note On Python 3.12 and older, the macro PY_SSIZE_T_CLEAN must be defined before including Python.h to use all # variants of formats (s#, y#, etc.) explained below. This is not necessary on Python 3.13 and later.
I didn't remove the recommendation because user may want to support older Pythons.
Python stdlib extensions still define the PY_SSIZE_T_CLEAN macro. Is it still useful? It's unclear to me.
I didn't remove them to ease review and avoid conflicts. But I will remove them all.
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