[Python-Dev] atexit missing an unregister method

2005-04-26 Thread Nick Jacobson
I was looking at the atexit module the other day; it seems like an elegant way to ensure that resources are cleaned up (that the garbage collector doesn't take care of). But while you can mark functions to be called with the 'register' method, there's no 'unregister' method to remove them from

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

2005-04-26 Thread Guido van Rossum
On 4/26/05, Nick Jacobson [EMAIL PROTECTED] wrote: I was looking at the atexit module the other day; it seems like an elegant way to ensure that resources are cleaned up (that the garbage collector doesn't take care of). But while you can mark functions to be called with the 'register'

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

2005-04-26 Thread Raymond Hettinger
[Nick Jacobson] I was looking at the atexit module the other day; it seems like an elegant way to ensure that resources are cleaned up (that the garbage collector doesn't take care of). But while you can mark functions to be called with the 'register' method, there's no 'unregister' method

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

2005-04-26 Thread Greg Ewing
Nick Jacobson wrote: But while you can mark functions to be called with the 'register' method, there's no 'unregister' method to remove them from the stack of functions to be called. You can always build your own mechanism for managing cleanup functions however you want, and register a single