diff options
author | Victor Stinner <vstinner@python.org> | 2023-08-26 02:05:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-26 02:05:17 (GMT) |
commit | 8ba47146111d714c7b61825d43b52311d9be366d (patch) | |
tree | 061438cacfecebab0264ef41fb94e11a40431924 /Include/internal/pycore_abstract.h | |
parent | 6353c21b78a3d91e7cd7810f1c00258a34e85fe7 (diff) | |
download | cpython-8ba47146111d714c7b61825d43b52311d9be366d.zip cpython-8ba47146111d714c7b61825d43b52311d9be366d.tar.gz cpython-8ba47146111d714c7b61825d43b52311d9be366d.tar.bz2 |
gh-106320: Remove private AC converter functions (#108505)
Move these private functions to the internal C API
(pycore_abstract.h):
* _Py_convert_optional_to_ssize_t()
* _PyNumber_Index()
Argument Clinic now emits #include "pycore_abstract.h" when these
functions are used.
The parser of the c-analyzer tool now uses a list of files which use
the limited C API, rather than a list of files using the internal C
API.
Diffstat (limited to 'Include/internal/pycore_abstract.h')
-rw-r--r-- | Include/internal/pycore_abstract.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/internal/pycore_abstract.h b/Include/internal/pycore_abstract.h index 2733d81..3cc0afa 100644 --- a/Include/internal/pycore_abstract.h +++ b/Include/internal/pycore_abstract.h @@ -47,6 +47,13 @@ extern int _PyObject_RealIsInstance(PyObject *inst, PyObject *cls); extern int _PyObject_RealIsSubclass(PyObject *derived, PyObject *cls); +// Convert Python int to Py_ssize_t. Do nothing if the argument is None. +// Export for '_bisect' shared extension. +PyAPI_FUNC(int) _Py_convert_optional_to_ssize_t(PyObject *, void *); + +// Same as PyNumber_Index() but can return an instance of a subclass of int. +// Export for 'math' shared extension. +PyAPI_FUNC(PyObject*) _PyNumber_Index(PyObject *o); #ifdef __cplusplus } |