[Python-Dev] Re: atexit missing an unregister method

Raymond Hettinger python at rcn.com
Mon Apr 25 23:20:35 CEST 2005


[Raymond Hettinger]
> << Will mull it over for a while.  My first impression is that
try/finally
> is a better tool for the scenario you outlined.  >>


[Nick Jacobson]
> You're right.  try/finally takes care of my sample scenario.  There
may
> still be a case to be made for atexit.unregister(), though.

Now is the time to move the discussion to SF feature requests or to
comp.lang.python.  If you devote time to "making a case", then also
devote equal effort to researching the hazards and API issues.  

"Potentially useful" is usually trumped by "potentially harmful".  Also,
if the API is awkward or error-prone, that is a bad sign.

Specifically, consider whether exposing the data structure opens the
possibility of accidentally violating invariants assumed by other calls
of atexit().

With respect to the API, consider whether you could explain to a newbie
(who has just finished the tutorial) how to access the structure, lookup
a target function, and make appropriate modifications without breaking
anything else.



Raymond


More information about the Python-Dev mailing list