Add migration advice about the atexit module.

This commit is contained in:
Raymond Hettinger 2004-08-16 03:14:53 +00:00
parent 7d419abf3c
commit edbdb24ac4
1 changed files with 15 additions and 0 deletions

View File

@ -395,6 +395,21 @@ Pattern::
"foobar"[-3:] == "bar" --> "foobar".endswith("bar")
The ``atexit`` Module
'''''''''''''''''''''
The atexit module supports multiple functions to be executed upon
program termination. Also, it supports parameterized functions.
Unfortunately, its implementation conflicts with the sys.exitfunc
attribute which only supports a single exit function. Code relying
on sys.exitfunc may interfere with other modules (including library
modules) that elect to use the newer and more versatile atexit module.
Pattern::
sys.exitfunc = myfunc --> atexit.register(myfunc)
Python 1.5 or Later
-------------------