Kristján Valur Jónsson added the comment:

There are two cases when remove_subclass is called:
One when we are changing base classes(the original use of this function), and 
in this case we must find the correct one.

The second one is when the class is being deleted, for housekeeping of the 
weakrefs.
I worry that your alternative will cause us to walk the entire list in the 
second case because it will be called when the weakref has been cleared, so  it 
will never find itself in the list, only None.  I'll make some tests to verify.

I think perhaps a small adjustment, an "exact" flag or something, can be added 
to differentiate between the two cases....

----------

_______________________________________
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