__del__ problem - would adopting Garbage Collection fix this?

Dave Abrahams abrahams at mediaone.net
Thu Apr 20 01:27:11 EDT 2000


in article slrn8ft35a.uqs.nascheme at cranky.arctrix.com, Neil Schemenauer at
nascheme at enme.ucalgary.ca wrote on 4/19/00 11:50 PM:

> Well, I guess I should. :)
> 
> When garbage is found by the collector (ie. reference cycles not
> reachable from Python), all objects reachable from __del__
> methods are moved into a separate set.  This is what I call
> uncollectable garbage.  Uncollectable instances are currently
> added to a global list of uncollectable objects reachable from
> within Python.  If the programmer creates such garbage it is up
> to them to deal with it.

Hmm. If the objects are really garbage (i.e. unreferenceable by the
programmer), then there really is nothing she can do to deal with it. Of
course you can't call the __del__ method, but it seems you should be able to
reclaim the memory occupied by the objects without losing anything.

-Dave




More information about the Python-list mailing list