> ...does it actually work to re-enter a main loop from inside a __del__ > callback? It seems like you could get into really nasty states with > multiple nested __del__ calls, or if a single sweep detects multiple > pieces of garbage with __del__ methods, then some of those __del__ > calls could be delayed indefinitely while the first __del__ runs. Is > the cycle collector even re-entrant?
We can have a flag on the async gen object to make sure that we run the finalizer only once. The finalizer will likely schedule async_gen.aclose() coroutine which will ensure a strong ref to the gen until it is closed. This can actually work.. ;) Yury _______________________________________________ Async-sig mailing list Async-sig@python.org https://mail.python.org/mailman/listinfo/async-sig Code of Conduct: https://www.python.org/psf/codeofconduct/