mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Sigh. Strengthen the resriction of the previous checkin: tp_new is
inherited unless *both*: (a) the base type is 'object', and (b) the subtype is not a "heap" type.
This commit is contained in:
parent
c11e192d41
commit
29687cd211
1 changed files with 2 additions and 1 deletions
|
@ -1152,7 +1152,8 @@ inherit_slots(PyTypeObject *type, PyTypeObject *base)
|
|||
COPYSLOT(tp_dictoffset);
|
||||
COPYSLOT(tp_init);
|
||||
COPYSLOT(tp_alloc);
|
||||
if (type->tp_flags & Py_TPFLAGS_HEAPTYPE) {
|
||||
if (base != &PyBaseObject_Type ||
|
||||
(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) {
|
||||
COPYSLOT(tp_new);
|
||||
}
|
||||
COPYSLOT(tp_free);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue