Kristján Valur Jónsson added the comment: It turned out to be slightly more compilcated. Two additions make this complete: 1) check for the subtype OR the Py_None when removing subclass. This removes any dependency on the order in which weakrefs are cleared. 2) When the type is cleared, manually remove ourselves from all the base classes.
It is because of the lack of 2) that the original version was always clearing out all stale weakrefs when new subclasses were added. ---------- Added file: http://bugs.python.org/file30218/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