Author kristjan.jonsson
Recipients kristjan.jonsson, pitrou, vstinner
Date 2013-05-13.17:29:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1368466199.86.0.987728143845.issue17936@psf.upfronthosting.co.za>
In-reply-to
Content
That is not sufficient.  The weakrefs may have been cleared already if the deletion comes as a result of garbage collection (which is currently the only way classes get deleted.)

It is still easily demonstratably correct:
The previous version _only_ removed subclasses on setting __bases__.  Housekeeping of stale weakrefs was done when new classes were created.

This proposed version still properly removes subclasses when setting __bases__, but housekeeping of dead weakrefs is now moved to the point when a class is deleted.  To do housekeeping of stale weakrefs, it is sufficient to remove _one_ stale weakref for each class that is deleted.  It is not important that this is the correct stale weakref, all stale weakrefs are the same.

I've uploaded an updated patch with added in-line comments explaining the case.
History
Date User Action Args
2013-05-13 17:29:59kristjan.jonssonsetrecipients: + kristjan.jonsson, pitrou, vstinner
2013-05-13 17:29:59kristjan.jonssonsetmessageid: <1368466199.86.0.987728143845.issue17936@psf.upfronthosting.co.za>
2013-05-13 17:29:59kristjan.jonssonlinkissue17936 messages
2013-05-13 17:29:59kristjan.jonssoncreate