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

2005-04-26 Thread Raymond Hettinger
[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

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

2005-04-26 Thread Martin v. Löwis
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

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

2005-04-26 Thread Nick Jacobson
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

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

2005-04-26 Thread Nick Jacobson
<< 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