A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-August/047874.html below:

[Python-Dev] Deprecate sys.exitfunc?

[Python-Dev] Deprecate sys.exitfunc? [Python-Dev] Deprecate sys.exitfunc?Armin Rigo arigo at tunes.org
Mon Aug 16 13:33:57 CEST 2004
Hello Raymond,

On Sun, Aug 15, 2004 at 05:41:26PM -0400, Raymond Hettinger wrote:
> The atexit module does attempt to co-exist by introducing code to
> register a function in sys.exitfunc if it were defined before "import
> atexit" was called.  However, this is unreliable because it depends on
> import order and the library is free to introduce an earlier "import
> atexit" which would break code relying on the co-existance mechanism.

Multiple well-written modules can use sys.exitfunc in a way that is
compatible.  atexit is merely a glue to discourage non-well-written modules.  
I'd say that atexit should be encouraged but there is nothing wrong with using
sys.exitfunc directly, if one is aware of the common patching pattern:
"save-old-value, replace-with-my-function, upon-call-invoke-saved-old-value".


A bientôt,

Armin.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4