[docs] [issue15233] atexit: guarantee order of execution of registered functions?
report at bugs.python.org
Mon Jul 16 06:56:27 CEST 2012
Larry Hastings <larry at hastings.org> added the comment:
I have been meditating on this, and I'm not sure we should change 2.7. 3.2 might be okay.
The thing is, I fear we're not just talking about CPython implementation details, we're talking about the Python Standard Library. The existing documentation clearly gives alternative implementations free license to call atexit registered functions in any order they like. So it's conceivable that other implementations don't guarantee reverse order.
I don't know what the right thing is to do here. It seems like we could define atexit's behavior for 2.7 *if* all the major alternative implementations happily also implicitly guarantee reverse order. Failing that we probably shouldn't touch it. Or we could just document that reverse order is guaranteed in CPython only.
Of course, there are no alternative implementations that support 3.2. That's why I think 3.2 might be okay. It does seem strange to redefine part of the implicit language spec more than a year after the release shipped though.
Python tracker <report at bugs.python.org>
More information about the docs