8000 bpo-38062: [doc] clarify that atexit uses equality comparisons intern… · python/cpython@12803c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 12803c5

Browse files
authored
bpo-38062: [doc] clarify that atexit uses equality comparisons internally. (GH-26935)
1 parent 823460d commit 12803c5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

Doc/library/atexit.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ internal error is detected, or when :func:`os._exit` is called.
4848

4949
.. function:: unregister(func)
5050

51-
Remove *func* from the list of functions to be run at interpreter
52-
shutdown. After calling :func:`unregister`, *func* is guaranteed not to be
53-
called when the interpreter shuts down, even if it was registered more than
54-
once. :func:`unregister` silently does nothing if *func* was not previously
55-
registered.
51+
Remove *func* from the list of functions to be run at interpreter shutdown.
52+
:func:`unregister` silently does nothing if *func* was not previously
53+
registered. If *func* has been registered more than once, every occurrence
54+
of that function in the :mod:`atexit` call stack will be removed. Equality
55+
comparisons (``==``) are used internally during unregistration, so function
56+
references do not need to have matching identities.
5657

5758

5859
.. seealso::
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Clarify that atexit uses equality comparisons internally.

0 commit comments

Comments
 (0)
0