-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
gh-104922: Make PY_SSIZE_T_CLEAN
not mandatory
#104923
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5b26c21
Update document
methane 80eefbf
Make PY_SSIZE_T_CLEAN not mandatory.
methane 30a20f1
fixup
methane 2df6cc3
Merge remote-tracking branch 'upstream/main' into arg-ssize_t-by-default
methane bade650
Mark old APIs as abi_only
methane 2aa6af5
make regen-limited-abi
methane b4f0c3a
Add what's new entry
methane f11eb51
Fix reST
methane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,19 @@ | |
# error "this header file must not be included directly" | ||
#endif | ||
|
||
/* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier | ||
to mean Py_ssize_t */ | ||
#ifdef PY_SSIZE_T_CLEAN | ||
#define _Py_VaBuildStack _Py_VaBuildStack_SizeT | ||
#else | ||
PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list); | ||
PyAPI_FUNC(PyObject **) _Py_VaBuildStack( | ||
PyObject **small_stack, | ||
Py_ssize_t small_stack_len, | ||
const char *format, | ||
va_list va, | ||
Py_ssize_t *p_nargs); | ||
|
||
PyAPI_FUNC(PyObject **) _Py_VaBuildStack_SizeT( | ||
PyObject **small_stack, | ||
Py_ssize_t small_stack_len, | ||
const char *format, | ||
va_list va, | ||
Py_ssize_t *p_nargs); | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both of |
||
|
||
PyAPI_FUNC(int) _PyArg_UnpackStack( | ||
PyObject *const *args, | ||
|
@@ -43,13 +43,6 @@ PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t, | |
((!_Py_ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \ | ||
|| _PyArg_CheckPositional((funcname), (nargs), (min), (max))) | ||
|
||
PyAPI_FUNC(PyObject **) _Py_VaBuildStack( | ||
PyObject **small_stack, | ||
Py_ssize_t small_stack_len, | ||
const char *format, | ||
va_list va, | ||
Py_ssize_t *p_nargs); | ||
|
||
typedef struct _PyArg_Parser { | ||
int initialized; | ||
const char *format; | ||
|
@@ -63,13 +56,6 @@ typedef struct _PyArg_Parser { | |
struct _PyArg_Parser *next; | ||
} _PyArg_Parser; | ||
|
||
#ifdef PY_SSIZE_T_CLEAN | ||
#define _PyArg_ParseTupleAndKeywordsFast _PyArg_ParseTupleAndKeywordsFast_SizeT | ||
#define _PyArg_ParseStack _PyArg_ParseStack_SizeT | ||
#define _PyArg_ParseStackAndKeywords _PyArg_ParseStackAndKeywords_SizeT | ||
#define _PyArg_VaParseTupleAndKeywordsFast _PyArg_VaParseTupleAndKeywordsFast_SizeT | ||
#endif | ||
|
||
PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *, | ||
struct _PyArg_Parser *, ...); | ||
PyAPI_FUNC(int) _PyArg_ParseStack( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/C API/2023-05-25-17-30-43.gh-issue-104922.V6nibW.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
``PY_SSIZE_T_CLEAN`` is no longer required to use '#' specifier in APIs like | ||
:c:func:`PyArg_ParseTuple` and :c:func:`Py_BuildValue`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not a part of stable ABI.
_PyObject_CallMethodId_SizeT
is removed and_PyObject_CallMethodId
is ssize_t version.