[Python-ideas] Avoiding nested for try..finally: atexit for functions?

Sven Marnach sven at marnach.net
Thu Oct 20 17:44:46 CEST 2011


Jan Kaliszewski schrieb am Do, 20. Okt 2011, um 02:19:22 +0200:
>         def register(self, callback):
>             self.cleanup_callbacks.append(callback)

We should probably accept additional *args and **kwargs which will be
passed on to the callback, similar to atexit.register().  And possibly
add an unregister() method in analogy to atexit.unregister() as well?

Cheers,
    Sven



More information about the Python-ideas mailing list