[Python-Dev] Deprecate sys.exitfunc?

Armin Rigo arigo at tunes.org
Tue Aug 17 18:18:33 CEST 2004


Hello Guido,

On Tue, Aug 17, 2004 at 08:28:03AM -0700, Guido van Rossum wrote:
> > Well, none, really.  But let's not change the name sys.exitfunc just
> > for the sake of deprecation, because it will probably break existing
> > and well-behaving modules (not just non-well-behaving ones).
> 
> That's never been a reason not to deprecate something.

Sorry.  Sure.  What I was opposing here is Raymond's original claim in this 
thread, which was apparently the reason he wanted to deprecate sys.exitfunc:

"""
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.
"""

I claim that there is nothing unreliable or depending on import order here, as
long as all concerned parties do the right thing.  Now if there are other good
reasons to deprecate sys.exitfunc, like it being another way of doing
something for which a better interface is provided, then fine.


Armin


More information about the Python-Dev mailing list