Skip to content

Commit df5dc1c

Browse files
authored
bpo-43770: _PyTypes_Init() inits more static types (GH-25265)
1 parent a518099 commit df5dc1c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Objects/object.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include "pycore_pylifecycle.h"
1111
#include "pycore_pymem.h" // _PyMem_IsPtrFreed()
1212
#include "pycore_pystate.h" // _PyThreadState_GET()
13+
#include "pycore_symtable.h" // PySTEntry_Type
14+
#include "pycore_unionobject.h" // _Py_UnionType
1315
#include "frameobject.h"
1416
#include "interpreteridobject.h"
1517

@@ -1759,19 +1761,26 @@ _PyTypes_Init(void)
17591761
assert(PyType_Type.tp_base == &PyBaseObject_Type);
17601762

17611763
// All other static types
1764+
INIT_TYPE(PyAsyncGen_Type);
17621765
INIT_TYPE(PyBool_Type);
1766+
INIT_TYPE(PyByteArrayIter_Type);
17631767
INIT_TYPE(PyByteArray_Type);
1768+
INIT_TYPE(PyBytesIter_Type);
17641769
INIT_TYPE(PyBytes_Type);
17651770
INIT_TYPE(PyCFunction_Type);
17661771
INIT_TYPE(PyCMethod_Type);
17671772
INIT_TYPE(PyCallIter_Type);
17681773
INIT_TYPE(PyCapsule_Type);
17691774
INIT_TYPE(PyCell_Type);
17701775
INIT_TYPE(PyClassMethodDescr_Type);
1776+
INIT_TYPE(PyClassMethod_Type);
17711777
INIT_TYPE(PyCode_Type);
17721778
INIT_TYPE(PyComplex_Type);
17731779
INIT_TYPE(PyCoro_Type);
17741780
INIT_TYPE(PyDictItems_Type);
1781+
INIT_TYPE(PyDictIterItem_Type);
1782+
INIT_TYPE(PyDictIterKey_Type);
1783+
INIT_TYPE(PyDictIterValue_Type);
17751784
INIT_TYPE(PyDictKeys_Type);
17761785
INIT_TYPE(PyDictProxy_Type);
17771786
INIT_TYPE(PyDictRevIterItem_Type);
@@ -1788,32 +1797,45 @@ _PyTypes_Init(void)
17881797
INIT_TYPE(PyGen_Type);
17891798
INIT_TYPE(PyGetSetDescr_Type);
17901799
INIT_TYPE(PyInstanceMethod_Type);
1800+
INIT_TYPE(PyListIter_Type);
1801+
INIT_TYPE(PyListRevIter_Type);
17911802
INIT_TYPE(PyList_Type);
17921803
INIT_TYPE(PyLongRangeIter_Type);
17931804
INIT_TYPE(PyLong_Type);
17941805
INIT_TYPE(PyMemberDescr_Type);
17951806
INIT_TYPE(PyMemoryView_Type);
17961807
INIT_TYPE(PyMethodDescr_Type);
17971808
INIT_TYPE(PyMethod_Type);
1809+
INIT_TYPE(PyModuleDef_Type);
1810+
INIT_TYPE(PyModule_Type);
17981811
INIT_TYPE(PyODictItems_Type);
17991812
INIT_TYPE(PyODictIter_Type);
18001813
INIT_TYPE(PyODictKeys_Type);
18011814
INIT_TYPE(PyODictValues_Type);
18021815
INIT_TYPE(PyODict_Type);
18031816
INIT_TYPE(PyPickleBuffer_Type);
18041817
INIT_TYPE(PyProperty_Type);
1818+
INIT_TYPE(PyRangeIter_Type);
18051819
INIT_TYPE(PyRange_Type);
18061820
INIT_TYPE(PyReversed_Type);
1821+
INIT_TYPE(PySTEntry_Type);
18071822
INIT_TYPE(PySeqIter_Type);
1823+
INIT_TYPE(PySetIter_Type);
18081824
INIT_TYPE(PySet_Type);
18091825
INIT_TYPE(PySlice_Type);
18101826
INIT_TYPE(PyStaticMethod_Type);
18111827
INIT_TYPE(PyStdPrinter_Type);
18121828
INIT_TYPE(PySuper_Type);
18131829
INIT_TYPE(PyTraceBack_Type);
1830+
INIT_TYPE(PyTupleIter_Type);
18141831
INIT_TYPE(PyTuple_Type);
1832+
INIT_TYPE(PyUnicodeIter_Type);
18151833
INIT_TYPE(PyUnicode_Type);
18161834
INIT_TYPE(PyWrapperDescr_Type);
1835+
INIT_TYPE(Py_GenericAliasType);
1836+
INIT_TYPE(_PyAsyncGenASend_Type);
1837+
INIT_TYPE(_PyAsyncGenAThrow_Type);
1838+
INIT_TYPE(_PyAsyncGenWrappedValue_Type);
18171839
INIT_TYPE(_PyCoroWrapper_Type);
18181840
INIT_TYPE(_PyInterpreterID_Type);
18191841
INIT_TYPE(_PyManagedBuffer_Type);
@@ -1824,6 +1846,7 @@ _PyTypes_Init(void)
18241846
INIT_TYPE(_PyWeakref_CallableProxyType);
18251847
INIT_TYPE(_PyWeakref_ProxyType);
18261848
INIT_TYPE(_PyWeakref_RefType);
1849+
INIT_TYPE(_Py_UnionType);
18271850

18281851
return _PyStatus_OK();
18291852
#undef INIT_TYPE

0 commit comments

Comments
 (0)