Is there a way to hook into module destruction?

Gerald Kaszuba gerald.kaszuba at gmail.com
Sun Jun 17 08:03:09 CEST 2007


On Jun 17, 6:16 am, Neal Becker <ndbeck... at gmail.com> wrote:
> Code at global scope in a module is run at module construction (init).  Is
> it possible to hook into module destruction (unloading)?

Try the __del__ method.

See http://docs.python.org/ref/customization.html for the docs.

--
Gerald Kaszuba
http://geraldkaszuba.com




More information about the Python-list mailing list