[Python-checkins] r71734 - in python/trunk: Include/descrobject.h Include/sliceobject.h Objects/descrobject.c Objects/object.c Objects/sliceobject.c
benjamin.peterson
python-checkins at python.org
Sun Apr 19 00:15:27 CEST 2009
Author: benjamin.peterson
Date: Sun Apr 19 00:15:26 2009
New Revision: 71734
Log:
many more types to initialize (I had to expose some of them)
Modified:
python/trunk/Include/descrobject.h
python/trunk/Include/sliceobject.h
python/trunk/Objects/descrobject.c
python/trunk/Objects/object.c
python/trunk/Objects/sliceobject.c
Modified: python/trunk/Include/descrobject.h
==============================================================================
--- python/trunk/Include/descrobject.h (original)
+++ python/trunk/Include/descrobject.h Sun Apr 19 00:15:26 2009
@@ -68,6 +68,9 @@
} PyWrapperDescrObject;
PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type;
+PyAPI_DATA(PyTypeObject) PyDictProxy_Type;
+PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type;
+PyAPI_DATA(PyTypeObject) PyMemberDescr_Type;
PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);
Modified: python/trunk/Include/sliceobject.h
==============================================================================
--- python/trunk/Include/sliceobject.h (original)
+++ python/trunk/Include/sliceobject.h Sun Apr 19 00:15:26 2009
@@ -25,6 +25,7 @@
} PySliceObject;
PyAPI_DATA(PyTypeObject) PySlice_Type;
+PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
#define PySlice_Check(op) (Py_TYPE(op) == &PySlice_Type)
Modified: python/trunk/Objects/descrobject.c
==============================================================================
--- python/trunk/Objects/descrobject.c (original)
+++ python/trunk/Objects/descrobject.c Sun Apr 19 00:15:26 2009
@@ -456,7 +456,7 @@
0, /* tp_descr_set */
};
-static PyTypeObject PyMemberDescr_Type = {
+PyTypeObject PyMemberDescr_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"member_descriptor",
sizeof(PyMemberDescrObject),
@@ -493,7 +493,7 @@
(descrsetfunc)member_set, /* tp_descr_set */
};
-static PyTypeObject PyGetSetDescr_Type = {
+PyTypeObject PyGetSetDescr_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"getset_descriptor",
sizeof(PyGetSetDescrObject),
@@ -819,7 +819,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 */
@@ -862,7 +862,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;
Modified: python/trunk/Objects/object.c
==============================================================================
--- python/trunk/Objects/object.c (original)
+++ python/trunk/Objects/object.c Sun Apr 19 00:15:26 2009
@@ -2,6 +2,7 @@
/* Generic object operations; and implementation of None (NoObject) */
#include "Python.h"
+#include "frameobject.h"
#ifdef __cplusplus
extern "C" {
@@ -2083,8 +2084,10 @@
if (PyType_Ready(&PyStaticMethod_Type) < 0)
Py_FatalError("Can't initialize static method type");
+#ifndef WITHOUT_COMPLEX
if (PyType_Ready(&PyComplex_Type) < 0)
- Py_FatalError("Can't initalize complex type");
+ Py_FatalError("Can't initialize complex type");
+#endif
if (PyType_Ready(&PyFloat_Type) < 0)
Py_FatalError("Can't initialize float type");
@@ -2115,6 +2118,45 @@
if (PyType_Ready(&PyReversed_Type) < 0)
Py_FatalError("Can't initialize reversed type");
+
+ if (PyType_Ready(&PyCode_Type) < 0)
+ Py_FatalError("Can't initialize code type");
+
+ if (PyType_Ready(&PyFrame_Type) < 0)
+ Py_FatalError("Can't initialize frame type");
+
+ if (PyType_Ready(&PyCFunction_Type) < 0)
+ Py_FatalError("Can't initialize builtin function type");
+
+ if (PyType_Ready(&PyMethod_Type) < 0)
+ Py_FatalError("Can't initialize method type");
+
+ if (PyType_Ready(&PyFunction_Type) < 0)
+ Py_FatalError("Can't initialize function type");
+
+ if (PyType_Ready(&PyClass_Type) < 0)
+ Py_FatalError("Can't initialize class type");
+
+ if (PyType_Ready(&PyDictProxy_Type) < 0)
+ Py_FatalError("Can't initialize dict proxy type");
+
+ if (PyType_Ready(&PyGen_Type) < 0)
+ Py_FatalError("Can't initialize generator type");
+
+ if (PyType_Ready(&PyGetSetDescr_Type) < 0)
+ Py_FatalError("Can't initialize get-set descriptor type");
+
+ if (PyType_Ready(&PyWrapperDescr_Type) < 0)
+ Py_FatalError("Can't initialize wrapper type");
+
+ if (PyType_Ready(&PyInstance_Type) < 0)
+ Py_FatalError("Can't initialize instance type");
+
+ if (PyType_Ready(&PyEllipsis_Type) < 0)
+ Py_FatalError("Can't initialize ellipsis type");
+
+ if (PyType_Ready(&PyMemberDescr_Type) < 0)
+ Py_FatalError("Can't initialize member descriptor type");
}
Modified: python/trunk/Objects/sliceobject.c
==============================================================================
--- python/trunk/Objects/sliceobject.c (original)
+++ python/trunk/Objects/sliceobject.c Sun Apr 19 00:15:26 2009
@@ -22,7 +22,7 @@
return PyString_FromString("Ellipsis");
}
-static PyTypeObject PyEllipsis_Type = {
+PyTypeObject PyEllipsis_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"ellipsis", /* tp_name */
0, /* tp_basicsize */
More information about the Python-checkins
mailing list