[Python-Dev] Re: [pygtk] How to delete Gtk objects
Guido van Rossum
guido@python.org
Wed, 10 Oct 2001 18:05:12 -0400
> which leads me to believe that __del__ would not be called in the current
> implementation. If people are going to be subclassing more than the
> traditional builtin types I think __del__ methods will have to be supported.
Correct, __del__ is not yet supported. (__coerce__ is, as of 2.2a4 at
least). I'm not sure that __del__ should be supported though: it
causes problems with the garbage collector. The GC won't destroy
objects with a __del__ method because it's impossible to decide in
which order to finalize mutually referencing objects.
Can somebody (e.g. whoever started this thread) present a good reason
why __del__ should be supported?
--Guido van Rossum (home page: http://www.python.org/~guido/)