Guido van Rossum <guido@python.org> writes: > When tp_dict is cleared, this can remove the __del__ method before it > can be called (it is called by the instance's tp_dealloc). That cannot happen: an object whose type has an __del__ cannot refer to an object for which tp_clear has been called. Objects with finalizers go into gc.garbage, so in this case, the type is resurrected, and not cleared. > tp_mro participates in a cycle too: it is a tuple whose first element > is the type itself. Tuples are immutable, so the tp_clear for tuples > doesn't do anything. So type_clear is our only hope to break this > cycle. I see. So tp_mro must be cleared in tp_clear; it's not used from subtype_dealloc, so it won't cause problems to clear it. Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4