PyAPI_DATA(PyTypeObject) PyMethodDescr_Type;
PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type;
PyAPI_DATA(PyTypeObject) PyDictProxy_Type;
+PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type;
PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);
/* This has no reason to be in this file except that adding new files is a
bit of a pain */
-/* forward */
-static PyTypeObject wrappertype;
-
typedef struct {
PyObject_HEAD
PyWrapperDescrObject *descr;
PyObject *self;
} wrapperobject;
-#define Wrapper_Check(v) (Py_TYPE(v) == &wrappertype)
+#define Wrapper_Check(v) (Py_TYPE(v) == &_PyMethodWrapper_Type)
static void
wrapper_dealloc(wrapperobject *wp)
return 0;
}
-static PyTypeObject wrappertype = {
+PyTypeObject _PyMethodWrapper_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"method-wrapper", /* tp_name */
sizeof(wrapperobject), /* tp_basicsize */
assert(_PyObject_RealIsSubclass((PyObject *)Py_TYPE(self),
(PyObject *)PyDescr_TYPE(descr)));
- wp = PyObject_GC_New(wrapperobject, &wrappertype);
+ wp = PyObject_GC_New(wrapperobject, &_PyMethodWrapper_Type);
if (wp != NULL) {
Py_INCREF(descr);
wp->descr = descr;
if (PyType_Ready(&PyWrapperDescr_Type) < 0)
Py_FatalError("Can't initialize wrapper type");
+ if (PyType_Ready(&_PyMethodWrapper_Type) < 0)
+ Py_FatalError("Can't initialize method wrapper type");
+
if (PyType_Ready(&PyEllipsis_Type) < 0)
Py_FatalError("Can't initialize ellipsis type");