Neil Schemenauer <nas-pyt...@arctrix.com> added the comment:
I think the problem with your logic is that the weakref to F is part of the garbage set. So, handle_finalizers() should detect that and clear the finalizer rather than call it. Once we get to delete_garbage() and start calling tp_clear(), we can't be running weakref callbacks or finalizers. The GC logic goes through great pains to ensure that. ---------- nosy: +nascheme _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38009> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com