mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
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.
This commit is contained in:
parent
6353c21b78
commit
8ba4714611
41 changed files with 88 additions and 62 deletions
3
Objects/clinic/bytearrayobject.c.h
generated
3
Objects/clinic/bytearrayobject.c.h
generated
|
|
@ -7,6 +7,7 @@ preserve
|
|||
# include "pycore_runtime.h" // _Py_ID()
|
||||
#endif
|
||||
|
||||
#include "pycore_abstract.h" // _PyNumber_Index()
|
||||
|
||||
static int
|
||||
bytearray___init___impl(PyByteArrayObject *self, PyObject *arg,
|
||||
|
|
@ -1284,4 +1285,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return bytearray_sizeof_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=cb94d7ac45f0a4b7 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=d388e9027b333f00 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
3
Objects/clinic/bytesobject.c.h
generated
3
Objects/clinic/bytesobject.c.h
generated
|
|
@ -7,6 +7,7 @@ preserve
|
|||
# include "pycore_runtime.h" // _Py_ID()
|
||||
#endif
|
||||
|
||||
#include "pycore_abstract.h" // _PyNumber_Index()
|
||||
|
||||
PyDoc_STRVAR(bytes___bytes____doc__,
|
||||
"__bytes__($self, /)\n"
|
||||
|
|
@ -1060,4 +1061,4 @@ skip_optional_pos:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=f4e85363c79c64d3 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=9da56b6c04914e18 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
3
Objects/clinic/listobject.c.h
generated
3
Objects/clinic/listobject.c.h
generated
|
|
@ -7,6 +7,7 @@ preserve
|
|||
# include "pycore_runtime.h" // _Py_ID()
|
||||
#endif
|
||||
|
||||
#include "pycore_abstract.h" // _PyNumber_Index()
|
||||
|
||||
PyDoc_STRVAR(list_insert__doc__,
|
||||
"insert($self, index, object, /)\n"
|
||||
|
|
@ -383,4 +384,4 @@ list___reversed__(PyListObject *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return list___reversed___impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=2ca109d8acc775bc input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=537a17b562c57505 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
3
Objects/clinic/longobject.c.h
generated
3
Objects/clinic/longobject.c.h
generated
|
|
@ -7,6 +7,7 @@ preserve
|
|||
# include "pycore_runtime.h" // _Py_ID()
|
||||
#endif
|
||||
|
||||
#include "pycore_abstract.h" // _PyNumber_Index()
|
||||
|
||||
static PyObject *
|
||||
long_new_impl(PyTypeObject *type, PyObject *x, PyObject *obase);
|
||||
|
|
@ -475,4 +476,4 @@ int_is_integer(PyObject *self, PyObject *Py_UNUSED(ignored))
|
|||
{
|
||||
return int_is_integer_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=75ed306fff493ba1 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=ea9c87ea532dadbe input=a9049054013a1b77]*/
|
||||
|
|
|
|||
3
Objects/clinic/unicodeobject.c.h
generated
3
Objects/clinic/unicodeobject.c.h
generated
|
|
@ -7,6 +7,7 @@ preserve
|
|||
# include "pycore_runtime.h" // _Py_ID()
|
||||
#endif
|
||||
|
||||
#include "pycore_abstract.h" // _PyNumber_Index()
|
||||
|
||||
PyDoc_STRVAR(EncodingMap_size__doc__,
|
||||
"size($self, /)\n"
|
||||
|
|
@ -1504,4 +1505,4 @@ skip_optional_pos:
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=2e1e1b136ef1b681 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=a64776a3ea1c970c input=a9049054013a1b77]*/
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
for any kind of float exception without losing portability. */
|
||||
|
||||
#include "Python.h"
|
||||
#include "pycore_abstract.h" // _PyNumber_Index()
|
||||
#include "pycore_dtoa.h" // _Py_dg_dtoa()
|
||||
#include "pycore_floatobject.h" // _PyFloat_FormatAdvancedWriter()
|
||||
#include "pycore_initconfig.h" // _PyStatus_OK()
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ preserve
|
|||
# include "pycore_runtime.h" // _Py_ID()
|
||||
#endif
|
||||
|
||||
#include "pycore_abstract.h" // _PyNumber_Index()
|
||||
|
||||
PyDoc_STRVAR(stringlib_expandtabs__doc__,
|
||||
"expandtabs($self, /, tabsize=8)\n"
|
||||
|
|
@ -278,4 +279,4 @@ stringlib_zfill(PyObject *self, PyObject *arg)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=00e34c03331699fe input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=a0338b2d41671b17 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue