summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-10-04 19:46:06 (GMT)
committerGuido van Rossum <guido@python.org>2001-10-04 19:46:06 (GMT)
commit50fda3ba267fe8c063ce83b832f349857ca7fdc3 (patch)
treec3f6dbc629cdc436c1f7714dacab4227b444c7e0 /Objects
parentba001a0b676f640b3a11dea48b2a13d9fc0be746 (diff)
downloadcpython-50fda3ba267fe8c063ce83b832f349857ca7fdc3.zip
cpython-50fda3ba267fe8c063ce83b832f349857ca7fdc3.tar.gz
cpython-50fda3ba267fe8c063ce83b832f349857ca7fdc3.tar.bz2
Make new classes dynamic by default.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index fae159c..e4f07e5 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -759,9 +759,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
1) in the class dict
2) in the module dict (globals)
The first variable that is an int >= 0 is used.
- Otherwise, a default is calculated from the base classes:
- if any base class is dynamic, this class is dynamic; otherwise
- it is static. */
+ Otherwise, the default is dynamic. */
dynamic = -1; /* Not yet determined */
/* Look in the class */
tmp = PyDict_GetItemString(dict, "__dynamic__");
@@ -783,19 +781,9 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
}
}
if (dynamic < 0) {
- /* Make a new class dynamic if any of its bases is
- dynamic. This is not always the same as inheriting
- the __dynamic__ class attribute! */
- dynamic = 0;
- for (i = 0; i < nbases; i++) {
- tmptype = (PyTypeObject *)
- PyTuple_GET_ITEM(bases, i);
- if (tmptype->tp_flags &
- Py_TPFLAGS_DYNAMICTYPE) {
- dynamic = 1;
- break;
- }
- }
+ /* Default to dynamic */
+ dynamic = 1;
+
}
/* Check for a __slots__ sequence variable in dict, and count it */