#define PyType_Check(op) PyObject_TypeCheck(op, &PyType_Type)
-extern DL_IMPORT(int) PyType_InitDict(PyTypeObject *);
+extern DL_IMPORT(int) PyType_Ready(PyTypeObject *);
extern DL_IMPORT(PyObject *) PyType_GenericAlloc(PyTypeObject *, int);
extern DL_IMPORT(PyObject *) PyType_GenericNew(PyTypeObject *,
PyObject *, PyObject *);
return NULL;
}
if (base_i->tp_dict == NULL) {
- if (PyType_InitDict(base_i) < 0)
+ if (PyType_Ready(base_i) < 0)
return NULL;
}
candidate = solid_base(base_i);
type->tp_free = _PyObject_Del;
/* Initialize the rest */
- if (PyType_InitDict(type) < 0) {
+ if (PyType_Ready(type) < 0) {
Py_DECREF(type);
return NULL;
}
/* Initialize this type (we'll assume the metatype is initialized) */
if (type->tp_dict == NULL) {
- if (PyType_InitDict(type) < 0)
+ if (PyType_Ready(type) < 0)
return NULL;
}
}
int
-PyType_InitDict(PyTypeObject *type)
+PyType_Ready(PyTypeObject *type)
{
PyObject *dict, *bases, *x;
PyTypeObject *base;
/* Initialize the base class */
if (base && base->tp_dict == NULL) {
- if (PyType_InitDict(base) < 0)
+ if (PyType_Ready(base) < 0)
return -1;
}
return PyDict_SetItemString(type->tp_defined, "__new__", func);
}
-/* This function is called by PyType_InitDict() to populate the type's
+/* This function is called by PyType_Ready() to populate the type's
dictionary with method descriptors for function slots. For each
function slot (like tp_repr) that's defined in the type, one or
more corresponding descriptors are added in the type's tp_defined
}
/* This is called at the very end of type_new() (even after
- PyType_InitDict()) to complete the initialization of dynamic types.
+ PyType_Ready()) to complete the initialization of dynamic types.
The dict argument is the dictionary argument passed to type_new(),
which is the local namespace of the class statement, in other
words, it contains the methods. For each special method (like
Py_FatalError("Py_Initialize: can't make first thread");
(void) PyThreadState_Swap(tstate);
- if (PyType_InitDict(&PyType_Type) < 0)
+ if (PyType_Ready(&PyType_Type) < 0)
Py_FatalError("Py_Initialize: can't initialize 'type'");
+ if (PyType_Ready(&PyList_Type) < 0)
+ Py_FatalError("Py_Initialize: can't initialize 'list'");
+
interp->modules = PyDict_New();
if (interp->modules == NULL)
Py_FatalError("Py_Initialize: can't make modules dictionary");