[issue8212] A tp_dealloc of a subclassed class cannot resurrect an object

Antoine Pitrou report at bugs.python.org
Mon Apr 16 15:31:13 CEST 2012


Antoine Pitrou <pitrou at free.fr> added the comment:

Urg, that's a horrible hack.
How about instead having an API function to resurrect an object from a tp_dealloc?

That way the iobase_dealloc code would be written:

    if (_PyIOBase_finalize((PyObject *) self) < 0) {
        _PyObject_ResurrectFromDealloc(self);
        return;
    }

That API function could also perhaps take care of the _Py_NewReference stuff (see the end of _PyIOBase_finalize).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8212>
_______________________________________


More information about the Python-bugs-list mailing list