gh-106320: Remove _PyAnextAwaitable_Type from the public C API (#108597)

It's not needed to declare it in Include/iterobject.h: just use
"extern" where it's used (only in object.c).
This commit is contained in:
Victor Stinner 2023-08-29 04:05:11 +02:00 committed by GitHub
parent 39506ee565
commit 301eb7e607
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 10 deletions

View file

@ -7,9 +7,6 @@ extern "C" {
PyAPI_DATA(PyTypeObject) PySeqIter_Type;
PyAPI_DATA(PyTypeObject) PyCallIter_Type;
#ifdef Py_BUILD_CORE
extern PyTypeObject _PyAnextAwaitable_Type;
#endif
#define PySeqIter_Check(op) Py_IS_TYPE((op), &PySeqIter_Type)

View file

@ -2049,11 +2049,12 @@ _PyObject_InitState(PyInterpreterState *interp)
}
extern PyTypeObject _Py_GenericAliasIterType;
extern PyTypeObject _PyMemoryIter_Type;
extern PyTypeObject _PyLineIterator;
extern PyTypeObject _PyPositionsIterator;
extern PyTypeObject _PyAnextAwaitable_Type;
extern PyTypeObject _PyLegacyEventHandler_Type;
extern PyTypeObject _PyLineIterator;
extern PyTypeObject _PyMemoryIter_Type;
extern PyTypeObject _PyPositionsIterator;
extern PyTypeObject _Py_GenericAliasIterType;
static PyTypeObject* static_types[] = {
// The two most important base types: must be initialized first and

View file

@ -69,7 +69,6 @@ def preprocess(filename,
cwd = os.path.abspath(cwd or '.')
filename = _normpath(filename, cwd)
print(filename)
postargs = POST_ARGS
if os.path.basename(filename) not in USE_LIMITED_C_API:
postargs += ('-DPy_BUILD_CORE=1',)

View file

@ -57,6 +57,7 @@ Objects/genobject.c - _PyCoroWrapper_Type -
Objects/interpreteridobject.c - PyInterpreterID_Type -
Objects/iterobject.c - PyCallIter_Type -
Objects/iterobject.c - PySeqIter_Type -
Objects/iterobject.c - _PyAnextAwaitable_Type -
Objects/listobject.c - PyListIter_Type -
Objects/listobject.c - PyListRevIter_Type -
Objects/listobject.c - PyList_Type -
@ -70,6 +71,7 @@ Objects/moduleobject.c - PyModule_Type -
Objects/namespaceobject.c - _PyNamespace_Type -
Objects/object.c - _PyNone_Type -
Objects/object.c - _PyNotImplemented_Type -
Objects/object.c - _PyAnextAwaitable_Type -
Objects/odictobject.c - PyODictItems_Type -
Objects/odictobject.c - PyODictIter_Type -
Objects/odictobject.c - PyODictKeys_Type -
@ -113,8 +115,6 @@ Objects/codeobject.c - _PyLineIterator -
Objects/codeobject.c - _PyPositionsIterator -
Objects/genericaliasobject.c - _Py_GenericAliasIterType -
# Not in a .h file:
Objects/iterobject.c - _PyAnextAwaitable_Type -
# Not in a .h file:
Objects/memoryobject.c - _PyMemoryIter_Type -
Objects/unicodeobject.c - _PyUnicodeASCIIIter_Type -
Objects/unionobject.c - _PyUnion_Type -

Can't render this file because it has a wrong number of fields in line 4.