Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-67056: document that registering/unregistering an atexit func from within an atexit func is undefined #104473

Merged
merged 7 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Doc/library/atexit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ internal error is detected, or when :func:`os._exit` is called.
This function returns *func*, which makes it possible to use it as a
decorator.

The effect of calling :func:`register` from another registered cleanup
function is undefined.


.. function:: unregister(func)

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

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

.. seealso::

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Document that the efect of registering or unregistering an :mod:`atexit`
iritkatriel marked this conversation as resolved.
Show resolved Hide resolved
cleanup function from within a registered cleanup function is undefined.