__del__ methods

Raymond Hettinger python at rcn.com
Fri Jul 18 19:51:12 EDT 2008


On Jul 18, 11:31 am, Jason Baker <amnorv... at gmail.com> 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?

FWIW, I know a good number of top notch Python programmers
who have programmed happily for years without ever using
__del__.  There are ways to get it to work for you, but
it may be the smart thing to pretend that you've never
heard of it.

Raymond




More information about the Python-list mailing list