Garbage collection

Duncan Booth duncan.booth at invalid.invalid
Tue Feb 19 05:39:26 EST 2008


Jarek Zgoda <jzgoda at o2.usun.pl> wrote:

> Is that true assumption that __del__ has the same purpose (and same
> limitations, i.e. the are not guaranteed to be fired) as Java finalizer
> methods?

One other point I should have mentioned about __del__: if you are running 
under Windows and the user hits Ctrl+Break then unless you handle it Python 
will exit without doing any cleanup at all (as opposed to any other method 
of exiting such as Ctrl+C). If this matters to you then you can install a 
signal handler to catch the Ctrl+Break and exit cleanly.



More information about the Python-list mailing list