[issue35983] tp_dealloc trashcan shouldn't be called for subclasses

Jeroen Demeyer report at bugs.python.org
Thu Mar 28 04:42:13 EDT 2019


Jeroen Demeyer <J.Demeyer at UGent.be> added the comment:

Changing types like that looks like an ugly hack and a recipe for breakage. For example, in list_dealloc(), the following needs the type to be correct:

    if (numfree < PyList_MAXFREELIST && PyList_CheckExact(op))
        free_list[numfree++] = op;
    else
        Py_TYPE(op)->tp_free((PyObject *)op);

Could you please clarify your opinion: do you think that there's something wrong with PR 11841? And if yes: what's wrong with it? Or are you just giving optional suggestions?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35983>
_______________________________________


More information about the Python-bugs-list mailing list