Some questions about atexit

Roy Smith roy at panix.com
Wed Sep 12 20:58:23 EDT 2012


The atexit docs (http://docs.python.org/library/atexit.html) are very 
confusing.  In one place they say, "The order in which the functions are 
called is not defined".  In another place, "all functions registered are 
called in last in, first out order".  Which is correct?

Also, it's not clear how atexit handlers interact with threading.  Do 
all handlers get called in the main thread?  What if some other thread 
registers a handler?  Does it get called in that thread?



More information about the Python-list mailing list