__del__ methods

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Fri Jul 18 15:10:33 EDT 2008


On Fri, 18 Jul 2008 11:31:20 -0700, Jason Baker wrote:

> I have a class that I need to do some finalization on when it dies.  I
> know I can use the __del__ method, but I seem to recall that it
> impedes garbage collection.  Is this the case?

`__del__()` is not a deterministic destructor.  So forget about reliable
automatic clean up.  Do it yourself with an explicit call to a `close()`
method or something like that.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list