__del__ problem - would adopting Garbage Collection fix this?

Just van Rossum just at letterror.com
Thu Apr 20 09:35:13 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.
>
At 6:09 AM +0000 20-04-2000, Neil Schemenauer wrote:
>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.

Sure, but nor should an exception ever occur in a __del__ method.

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

Maybe you're right, but to me it feels this is in the exact same category
as a __del__ exception, so ignoring & collecting seems more logical to me
as a default.

Just






More information about the Python-list mailing list