GC and finalizers [was: No destructor]
pduffin at hursley.ibm.com
Mon Sep 4 17:00:01 CEST 2000
Andrew Kuchling wrote:
> Most of the discussion of GC and finalizers happened on python-dev
> back in March, and many coulombs of electrons were expended in those
> discussions. See http://www.python.org/pipermail/python-dev/2000-March/
> The following threads are particularly relevant:
> Design question: call __del__ for cyclical garbage?
I had read most of this thread previously, along with the other thread
on how the cycles would be found in the first place. Unfortunately the
above thread ends abruptly with no outcome.
I have looked in the April and May archives but could not find the rest
of the thread.
The situation at the end of the thread was that Guido was still undecided
about how to handle it but seemed to prefer some cleanup mechanism
rather than just adding it to a global list.
I did quite like the guardian idea from Scheme that Tim talked about.
Maybe rather than one global list each class should have a list of
the instances of its objects which are in cycles and a class method
could be called to clean it up.
There is still the problem of what to do if the class does not
> Design question: call __del__ only after successful __init__?
> finalization again
> Back then, Tim Peters also posted a pointer to
> http://www.iecc.com/gclist/GC-faq.html, which talks about GC and
> finalizers a bit.
Read that too. Also read
http://reality.sgi.com/boehm_mti/finalization.html which neatly
sidesteps the issue by declaring
"Cycles involving one or more finalizable objects are never finalized."
More information about the Python-list