On Fri., 3 Jan. 2020, 3:52 am Yonatan Zunger, <zun...@humu.com> wrote:
> weakref.finalize always executes during the ordinary Python flow, IIUC -- > e.g., it happens before the interpreter is stopping. I guess it does still > have the "arbitrary thread" limitation -- which is a good point, I may have > some code bugs of my own to fix. But it's a huge difference in terms of > predictability of the interpreter state, and in particular both the issues > around deleted modules and the ones around threading no longer working > don't apply to it. > > atexit is a pretty corner-case thing -- I agree that it shouldn't be the > common thing at all, and the recommendation should be specifically for > those use cases where it makes sense. > And in the context of this particular discussion, has the limitation that atexit handlers run *after* the interpreter waits for non-daemon threads to stop. Cheers, Nick. >>
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/FLQJEIDZQFJMUIWRD66XDYWQNLZUYKHY/ Code of Conduct: http://python.org/psf/codeofconduct/