This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients bfroehle, larry, loewis, vstinner
Date 2014-01-31.11:41:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391168486.65.0.10873801381.issue17162@psf.upfronthosting.co.za>
In-reply-to
Content
It's certainly possible to write a "proper" dealloc - just call PyObject_Del directly. This is correct if the type isn't subclassable, and works if it actually isn't subclassed, or if the subclass object can also be released through PyObject_Del.

That this has *nobody* noticed yet isn't the case - the OP certainly noticed a year ago. Else, the limited API isn't in wide use yet, probably partly because it is too limited still for certain extension modules (but it is by design that it is limited at all, so that code might require active porting to use it, and may not be portable at all in certain cases).

If the typical use case is PyTYPE(self)->tp_free, then the type ought to be a heap type, so limiting the implementation to heap types should be sufficient. It would be feasible to extend it to non-heaptypes, although I do wonder what use case this would allow for.
History
Date User Action Args
2014-01-31 11:41:26loewissetrecipients: + loewis, vstinner, larry, bfroehle
2014-01-31 11:41:26loewissetmessageid: <1391168486.65.0.10873801381.issue17162@psf.upfronthosting.co.za>
2014-01-31 11:41:26loewislinkissue17162 messages
2014-01-31 11:41:26loewiscreate