Author r.david.murray
Recipients chortos, petri.lehtinen, python-dev, r.david.murray, serhiy.storchaka, terry.reedy, vstinner
Date 2013-09-21.22:27:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1379802437.7.0.574325556181.issue12085@psf.upfronthosting.co.za>
In-reply-to
Content
__del__ methods are in general tricky because they are in the general case run asynchronously.  Therefore any proposal to "attach" the message to another message is a non-starter.

If a __del__ method depends on attributes set in the __init__, then the programmer needs to decide if they want to handle the possibility of __init__ failing, and therefore __del__ running without __init__ having completed.  For the stdlib, I think I'd lean toward handling such cases, in which case IMO the Pythonic thing to do is indeed to have a class attribute to provide the pre-__init__ default.
History
Date User Action Args
2013-09-21 22:27:17r.david.murraysetrecipients: + r.david.murray, terry.reedy, vstinner, chortos, python-dev, petri.lehtinen, serhiy.storchaka
2013-09-21 22:27:17r.david.murraysetmessageid: <1379802437.7.0.574325556181.issue12085@psf.upfronthosting.co.za>
2013-09-21 22:27:17r.david.murraylinkissue12085 messages
2013-09-21 22:27:17r.david.murraycreate