@@ -387,7 +387,7 @@ best_base(PyObject *bases)
387387 return NULL ;
388388 }
389389 if (base_i -> tp_dict == NULL ) {
390- if (PyType_InitDict (base_i ) < 0 )
390+ if (PyType_Ready (base_i ) < 0 )
391391 return NULL ;
392392 }
393393 candidate = solid_base (base_i );
@@ -656,7 +656,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
656656 type -> tp_free = _PyObject_Del ;
657657
658658 /* Initialize the rest */
659- if (PyType_InitDict (type ) < 0 ) {
659+ if (PyType_Ready (type ) < 0 ) {
660660 Py_DECREF (type );
661661 return NULL ;
662662 }
@@ -719,7 +719,7 @@ type_getattro(PyTypeObject *type, PyObject *name)
719719
720720 /* Initialize this type (we'll assume the metatype is initialized) */
721721 if (type -> tp_dict == NULL ) {
722- if (PyType_InitDict (type ) < 0 )
722+ if (PyType_Ready (type ) < 0 )
723723 return NULL ;
724724 }
725725
@@ -1157,7 +1157,7 @@ inherit_slots(PyTypeObject *type, PyTypeObject *base)
11571157}
11581158
11591159int
1160- PyType_InitDict (PyTypeObject * type )
1160+ PyType_Ready (PyTypeObject * type )
11611161{
11621162 PyObject * dict , * bases , * x ;
11631163 PyTypeObject * base ;
@@ -1185,7 +1185,7 @@ PyType_InitDict(PyTypeObject *type)
11851185
11861186 /* Initialize the base class */
11871187 if (base && base -> tp_dict == NULL ) {
1188- if (PyType_InitDict (base ) < 0 )
1188+ if (PyType_Ready (base ) < 0 )
11891189 return -1 ;
11901190 }
11911191
@@ -1892,7 +1892,7 @@ add_tp_new_wrapper(PyTypeObject *type)
18921892 return PyDict_SetItemString (type -> tp_defined , "__new__" , func );
18931893}
18941894
1895- /* This function is called by PyType_InitDict () to populate the type's
1895+ /* This function is called by PyType_Ready () to populate the type's
18961896 dictionary with method descriptors for function slots. For each
18971897 function slot (like tp_repr) that's defined in the type, one or
18981898 more corresponding descriptors are added in the type's tp_defined
@@ -2335,7 +2335,7 @@ slot_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
23352335}
23362336
23372337/* This is called at the very end of type_new() (even after
2338- PyType_InitDict ()) to complete the initialization of dynamic types.
2338+ PyType_Ready ()) to complete the initialization of dynamic types.
23392339 The dict argument is the dictionary argument passed to type_new(),
23402340 which is the local namespace of the class statement, in other
23412341 words, it contains the methods. For each special method (like
0 commit comments