atexit functionality

Duncan Booth duncan at NOSPAMrcp.co.uk
Wed Apr 9 12:09:50 CEST 2003


[posted and mailed]

viszneki at telerama.com wrote in
news:mailman.1049821814.20582.python-list at python.org: 

> return _exithandlers[len(_exithandlers)]

> 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.
> 
In what way is asking for atexit.register to throw an IndexError exception 
every time it is called NOT introducing a negative side effect?

If you want to muck about with atexit functions the way to do it is to 
register your own function once, and have that maintain its own list that 
you can modify to your heart's content.

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?




More information about the Python-list mailing list