diff options
author | Guido van Rossum <guido@python.org> | 2006-07-27 21:53:35 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-07-27 21:53:35 (GMT) |
commit | 3cf5b1eef99fbd85bbd2bcd2e6223dfec92daf8b (patch) | |
tree | 310222781e7a80027e813b9e61b9b412fecc9a87 /Objects/classobject.c | |
parent | 73e5a5b65d66f4fba9c4f626bcd6400f4a7215e6 (diff) | |
download | cpython-3cf5b1eef99fbd85bbd2bcd2e6223dfec92daf8b.zip cpython-3cf5b1eef99fbd85bbd2bcd2e6223dfec92daf8b.tar.gz cpython-3cf5b1eef99fbd85bbd2bcd2e6223dfec92daf8b.tar.bz2 |
Get rid of most of the flags (in tp_flags) that keep track of various
variations of the type struct and its attachments. In Py3k, all type
structs have to have all fields -- no binary backwards compatibility.
Had to change the complex object to a new-style number!
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r-- | Objects/classobject.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c index aab35c7..fa8a3a9 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -4,8 +4,7 @@ #include "Python.h" #include "structmember.h" -#define TP_DESCR_GET(t) \ - (PyType_HasFeature(t, Py_TPFLAGS_HAVE_CLASS) ? (t)->tp_descr_get : NULL) +#define TP_DESCR_GET(t) ((t)->tp_descr_get) /* Forward */ @@ -2045,7 +2044,7 @@ PyTypeObject PyInstance_Type = { (getattrofunc)instance_getattr, /* tp_getattro */ (setattrofunc)instance_setattr, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_CHECKTYPES,/*tp_flags*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /*tp_flags*/ instance_doc, /* tp_doc */ (traverseproc)instance_traverse, /* tp_traverse */ 0, /* tp_clear */ @@ -2149,7 +2148,7 @@ instancemethod_getattro(PyObject *obj, PyObject *name) PyTypeObject *tp = obj->ob_type; PyObject *descr = NULL; - if (PyType_HasFeature(tp, Py_TPFLAGS_HAVE_CLASS)) { + { if (tp->tp_dict == NULL) { if (PyType_Ready(tp) < 0) return NULL; @@ -2468,7 +2467,7 @@ PyTypeObject PyMethod_Type = { instancemethod_getattro, /* tp_getattro */ PyObject_GenericSetAttr, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_WEAKREFS, /* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ instancemethod_doc, /* tp_doc */ (traverseproc)instancemethod_traverse, /* tp_traverse */ 0, /* tp_clear */ |