On Thu, Nov 13, 2014 at 1:44 PM, Skip Montanaro
<skip.montan...@gmail.com> wrote:
> On Thu, Nov 13, 2014 at 2:33 PM, Ian Kelly <ian.g.ke...@gmail.com> wrote:
>> ... other things decorated with atexit.register
>> might actually be called before the main function
>
> I don't think that will happen. The atexit module is documented to
> execute its exit functions in reverse order.

Right, so if something else gets registered after the main function,
it will be called before the main function.

> What's not documented is
> the behavior of calling atexit.register() while atexit._run_exitfuncs
> is running. That's an implementation detail, and though unlikely to
> change, it might be worthwhile getting that behavior documented.

Since the exit functions are executed in reverse order, anything
registered at this time would have to be called before something else
that has already been called, so I would expect this to be an error
condition.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to