Glenn Maynard added the comment:

This would be useful.  It shouldn't be part of atexit, since atexit.register() 
from a thread should register a process-exit handler; instead, something like 
threading.(un)register_atexit().  If called in a thread, the calls happen when 
run() returns; if called in the main thread, call them when regular atexits are 
called (perhaps interleaved with atexit, as if atexit.register had been used).

For example, this can be helpful to handle cleaning up per-thread singletons 
like database connections.

----------
nosy: +Glenn.Maynard

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14073>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to