[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(), th
Nick Jacobson wrote:
> You're right. try/finally takes care of my sample scenario. There may
> still be a case to be made for atexit.unregister(), though.
No. Anybody in need of such a feature can easily unregister it.
allregistrations=[]
def _run():
for fn in allregistrations:
fn()
ate
Raymond Hettinger wrote:
<< Will mull it over for a while. My first impression is that try/finally
is a better tool for the scenario you outlined. >>
You're right. try/finally takes care of my sample scenario. There may
still be a case to be made for atexit.unregister(), though.
--Nick Jacobs
<< This seems like a poor argument for unregistering exit handlers. If
you've
registered an exit handler, why then explicitly do what you've already asked
the system to do? >>
1. To free up memory for the rest of the program.
2. If the following block is in a loop, and you need to allocate & the