Mercurial > cpython-lru_cache-weakref
diff Objects/classobject.c @ 39222:b0cdcbcc5f45
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!
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 27 Jul 2006 21:53:35 +0000 |
| parents | a19c20c5e5c7 |
| children | 654c380cf8b9 |
line wrap: on
line diff
--- a/Objects/classobject.c Thu Jun 08 15:35:45 2006 +0000 +++ b/Objects/classobject.c Thu Jul 27 21:53:35 2006 +0000 @@ -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 @@ (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 @@ 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 @@ 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 */
