using modules in destructors

Michele Simionato michele.simionato at
Fri Oct 24 16:06:03 CEST 2008

This is expected behavior (see
but it is definitely a wart of Python. The best advice I can give you
is *never* use __del__. There are alternatives,
such as the with statement, weak references or atexit.
See for instance
If you Google in this newsgroup for __del__ you will find a lot of

  Michele Simionato

More information about the Python-list mailing list