__del__ problem - would adopting Garbage Collection fix this?

Neil Schemenauer nascheme at enme.ucalgary.ca
Thu Apr 20 08:09:36 CEST 2000


Dave Abrahams <abrahams at mediaone.net> wrote:
>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.

Uncollectable garbage is placed in a list reachable from Python
(ie. gc.garbage).

>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.

Maybe, but what are the __del__ methods for if they are not to
free resources?  This situation really should not occur.  With
the default debugging options the collector prints a message to
sys.stderr when it finds uncollectable objects.  Redesigning the
class structure should fix the problem.


    Neil

-- 
HTML needs a rant tag. --Alan Cox



More information about the Python-list mailing list