Skip to content

Commit

Permalink
bpo-43770: _PyTypes_Init() inits more static types (GH-25265)
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner authored Apr 7, 2021
1 parent a518099 commit df5dc1c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Objects/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "pycore_pylifecycle.h"
#include "pycore_pymem.h" // _PyMem_IsPtrFreed()
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_symtable.h" // PySTEntry_Type
#include "pycore_unionobject.h" // _Py_UnionType
#include "frameobject.h"
#include "interpreteridobject.h"

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

// All other static types
INIT_TYPE(PyAsyncGen_Type);
INIT_TYPE(PyBool_Type);
INIT_TYPE(PyByteArrayIter_Type);
INIT_TYPE(PyByteArray_Type);
INIT_TYPE(PyBytesIter_Type);
INIT_TYPE(PyBytes_Type);
INIT_TYPE(PyCFunction_Type);
INIT_TYPE(PyCMethod_Type);
INIT_TYPE(PyCallIter_Type);
INIT_TYPE(PyCapsule_Type);
INIT_TYPE(PyCell_Type);
INIT_TYPE(PyClassMethodDescr_Type);
INIT_TYPE(PyClassMethod_Type);
INIT_TYPE(PyCode_Type);
INIT_TYPE(PyComplex_Type);
INIT_TYPE(PyCoro_Type);
INIT_TYPE(PyDictItems_Type);
INIT_TYPE(PyDictIterItem_Type);
INIT_TYPE(PyDictIterKey_Type);
INIT_TYPE(PyDictIterValue_Type);
INIT_TYPE(PyDictKeys_Type);
INIT_TYPE(PyDictProxy_Type);
INIT_TYPE(PyDictRevIterItem_Type);
Expand All @@ -1788,32 +1797,45 @@ _PyTypes_Init(void)
INIT_TYPE(PyGen_Type);
INIT_TYPE(PyGetSetDescr_Type);
INIT_TYPE(PyInstanceMethod_Type);
INIT_TYPE(PyListIter_Type);
INIT_TYPE(PyListRevIter_Type);
INIT_TYPE(PyList_Type);
INIT_TYPE(PyLongRangeIter_Type);
INIT_TYPE(PyLong_Type);
INIT_TYPE(PyMemberDescr_Type);
INIT_TYPE(PyMemoryView_Type);
INIT_TYPE(PyMethodDescr_Type);
INIT_TYPE(PyMethod_Type);
INIT_TYPE(PyModuleDef_Type);
INIT_TYPE(PyModule_Type);
INIT_TYPE(PyODictItems_Type);
INIT_TYPE(PyODictIter_Type);
INIT_TYPE(PyODictKeys_Type);
INIT_TYPE(PyODictValues_Type);
INIT_TYPE(PyODict_Type);
INIT_TYPE(PyPickleBuffer_Type);
INIT_TYPE(PyProperty_Type);
INIT_TYPE(PyRangeIter_Type);
INIT_TYPE(PyRange_Type);
INIT_TYPE(PyReversed_Type);
INIT_TYPE(PySTEntry_Type);
INIT_TYPE(PySeqIter_Type);
INIT_TYPE(PySetIter_Type);
INIT_TYPE(PySet_Type);
INIT_TYPE(PySlice_Type);
INIT_TYPE(PyStaticMethod_Type);
INIT_TYPE(PyStdPrinter_Type);
INIT_TYPE(PySuper_Type);
INIT_TYPE(PyTraceBack_Type);
INIT_TYPE(PyTupleIter_Type);
INIT_TYPE(PyTuple_Type);
INIT_TYPE(PyUnicodeIter_Type);
INIT_TYPE(PyUnicode_Type);
INIT_TYPE(PyWrapperDescr_Type);
INIT_TYPE(Py_GenericAliasType);
INIT_TYPE(_PyAsyncGenASend_Type);
INIT_TYPE(_PyAsyncGenAThrow_Type);
INIT_TYPE(_PyAsyncGenWrappedValue_Type);
INIT_TYPE(_PyCoroWrapper_Type);
INIT_TYPE(_PyInterpreterID_Type);
INIT_TYPE(_PyManagedBuffer_Type);
Expand All @@ -1824,6 +1846,7 @@ _PyTypes_Init(void)
INIT_TYPE(_PyWeakref_CallableProxyType);
INIT_TYPE(_PyWeakref_ProxyType);
INIT_TYPE(_PyWeakref_RefType);
INIT_TYPE(_Py_UnionType);

return _PyStatus_OK();
#undef INIT_TYPE
Expand Down

0 comments on commit df5dc1c

Please sign in to comment.