@@ -22,7 +22,8 @@ is detected, or when :func:`os._exit` is called.
2222
2323 Register *func * as a function to be executed at termination. Any optional
2424 arguments that are to be passed to *func * must be passed as arguments to
25- :func: `register `.
25+ :func: `register `. It is possible to register the same function and arguments
26+ more than once.
2627
2728 At normal program termination (for instance, if :func: `sys.exit ` is called or
2829 the main module's execution completes), all functions registered are called in
@@ -35,15 +36,17 @@ is detected, or when :func:`os._exit` is called.
3536 saved. After all exit handlers have had a chance to run the last exception to
3637 be raised is re-raised.
3738
38- This function returns *func * which makes it possible to use it as a decorator
39- without binding the original name to `` None `` .
39+ This function returns *func *, which makes it possible to use it as a
40+ decorator .
4041
4142
4243.. function :: unregister(func)
4344
44- Remove a function *func * from the list of functions to be run at interpreter-
45+ Remove *func * from the list of functions to be run at interpreter
4546 shutdown. After calling :func: `unregister `, *func * is guaranteed not to be
46- called when the interpreter shuts down.
47+ called when the interpreter shuts down, even if it was registered more than
48+ once. :func: `unregister ` silently does nothing if *func * was not previously
49+ registered.
4750
4851
4952.. seealso ::
@@ -100,6 +103,4 @@ Usage as a :term:`decorator`::
100103 def goodbye():
101104 print("You are now leaving the Python sector.")
102105
103- This obviously only works with functions that don't take arguments.
104-
105-
106+ This only works with functions that can be called without arguments.
0 commit comments