atexit functionality

viszneki at telerama.com viszneki at telerama.com
Tue Apr 8 13:30:18 EDT 2003


I am not a member of the Python mailing list, I dont' have the time to read any 
mailing lists at the moment. So if someone could please respond to me 
personally, that would be great.

Generally speaking I have a lot of objects that clean themselves up before 
python actually exits, so I was wondering if a deregister function could be 
provided.

Rather than a deregister function, I thought about making the following 
modification to atexit.py after _exithandlers.append((func,targs,kargs))

return _exithandlers[len(_exithandlers)]

My intention is to be able to store the returned value as a member variable in 
a class that registers its own cleanup functions. But if the class cleans 
itself up, the class could "clean up" its cleanup registration with atexit by 
saying something like del self.cleanup

I hope my ideas are well received! I think they will be because this 
modification is fully backward compatible, and doesn't introduce any negative 
side effects or anything like that.

Thanks for your time,
Donny Viszneki.

ps, could someone please personally respond to my email address 
viszneki at telerama.com about any decisions made about my idea? thanks a lot. 





More information about the Python-list mailing list