Allan Feldman <allan.d.feld...@gmail.com> added the comment:
Also I just noticed this statement: > In current CPython, for your ForeverObject(False), `del o` does not make the > object trash "for real". __del__ runs immediately (due to deterministic, > synchronous reference counting) and resurrects it. That cuts off the "about > to have its memory destroyed and recycled" part, so the callback doesn't run. The problem is the callback _does_ run even though the object is resurrected! :) (Only if going through gc) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40312> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com