Skip to content

Commit d3127cd

Browse files
committed
gh-67056: document that registering/unregistering an atexit func from within an atexit func is undefined
1 parent 080a596 commit d3127cd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Doc/library/atexit.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ internal error is detected, or when :func:`os._exit` is called.
4545
This function returns *func*, which makes it possible to use it as a
4646
decorator.
4747

48+
The effect of calling :func:`register` from another registered cleanup
49+
function is undefined.
50+
4851

4952
.. function:: unregister(func)
5053

@@ -55,6 +58,8 @@ internal error is detected, or when :func:`os._exit` is called.
5558
comparisons (``==``) are used internally during unregistration, so function
5659
references do not need to have matching identities.
5760

61+
The effect of calling :func:`unregister` from a registered cleanup function
62+
is undefined.
5863

5964
.. seealso::
6065

0 commit comments

Comments
 (0)