[issue9788] atexit and execution order

Éric Araujo report at bugs.python.org
Tue Sep 7 16:59:12 CEST 2010

Éric Araujo <merwok at netwok.org> added the comment:

It seems to me that atexit is simple by design: It registers callables that do one thing, period. If you have dependencies in your cleanup code, you should write a function doing the Right Thing™ and register that. This keeps the implementation simple, otherwise we’d have to debate LIFO vs. FIFO, adding an argument to register vs. exposing the list of callables, etc.

If you agree, I could make a patch to make the docs more explicit about atexit’s simplicity and lack of guarantee about run order.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list