Is there a way to hook into module destruction?

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

On Jun 17, 6:16 am, Neal Becker <ndbeck... at> 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 for the docs.

Gerald Kaszuba

More information about the Python-list mailing list