[Python-Dev] Deprecate sys.exitfunc?

Raymond Hettinger python at rcn.com
Tue Aug 17 18:38:15 CEST 2004


[Armin]
> I claim that there is nothing unreliable or depending on import order
> here, as
> long as all concerned parties do the right thing.

Right.  It's only unreliable if a party takes an obvious, but not wise
approach.


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

That is the case.  The API for at exit accepts function arguments and
automatically handles multiple exit functions.  It is careful to handle
the multiple exits using pop() in case another exit function alters the
function list or in case multiple threads are using atexit.  So, yes
there is a better API that should be the one preferred way to do it.


Raymond



More information about the Python-Dev mailing list