Added all PyTypeObjects to the appropriate header files.
Before the patch a lot of internal types weren't available in the header files. The patch exposes the new iterators, views and some other types to all C modules. I've also renamed some of the types and tp_names.
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 294c7b3..c4d55e4 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -383,7 +383,7 @@
return 0;
}
-static PyTypeObject PyMethodDescr_Type = {
+PyTypeObject PyMethodDescr_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"method_descriptor",
sizeof(PyMethodDescrObject),
@@ -421,7 +421,7 @@
};
/* This is for METH_CLASS in C, not for "f = classmethod(f)" in Python! */
-static PyTypeObject PyClassMethodDescr_Type = {
+PyTypeObject PyClassMethodDescr_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"classmethod_descriptor",
sizeof(PyMethodDescrObject),
@@ -458,7 +458,7 @@
0, /* tp_descr_set */
};
-static PyTypeObject PyMemberDescr_Type = {
+PyTypeObject PyMemberDescr_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"member_descriptor",
sizeof(PyMemberDescrObject),
@@ -495,7 +495,7 @@
(descrsetfunc)member_set, /* tp_descr_set */
};
-static PyTypeObject PyGetSetDescr_Type = {
+PyTypeObject PyGetSetDescr_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"getset_descriptor",
sizeof(PyGetSetDescrObject),
@@ -786,7 +786,7 @@
return PyObject_RichCompare(v->dict, w, op);
}
-static PyTypeObject proxytype = {
+PyTypeObject PyDictProxy_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"dictproxy", /* tp_name */
sizeof(proxyobject), /* tp_basicsize */
@@ -829,7 +829,7 @@
{
proxyobject *pp;
- pp = PyObject_GC_New(proxyobject, &proxytype);
+ pp = PyObject_GC_New(proxyobject, &PyDictProxy_Type);
if (pp != NULL) {
Py_INCREF(dict);
pp->dict = dict;