Logging in __del__()

Robert Rawlins robert.rawlins at thinkbluemedia.co.uk
Tue Jul 15 14:51:25 CEST 2008

Hi Fredrik,

> When the application is running, or when it is shutting down?

This is interesting, I did a test where I explicitly destroyed the instance
using 'del my_instance' while the application was running and no error was

It would see you are right, when the application ends it kills the logging
module before my classes. I think you're on the right approach just
try/except it and leave it be.

Am I right in thinking that Python destroys instances of classes when it
deems they are no longer needed? I shouldn't have to explicitly delete the
classes, right?

Thanks Fredrik,


More information about the Python-list mailing list