Kristján Valur Jónsson added the comment:

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.

----------
Added file: http://bugs.python.org/file30253/subtype.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17936>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to