Python 2.0

Graham Matthews graham at sloth.math.uga.edu
Fri Jun 4 10:37:32 EDT 1999


Salvador =?iso-8859-1?Q?Fandi=F1o?= (fandino at usa.net) wrote:
: GC usually deletes objects in random order which is not a very good
: behavior.
Graham Matthews wrote:
> I am sorry but this comment is all myth.
Salvador =?iso-8859-1?Q?Fandi=F1o?= (fandino at usa.net) wrote:
: No, it's a real problem I had in my current project. You can't delete
: complex data structures just deleting component objects in random order.

The proposal I gave for adding mark sweep collection on top of reference
counts will delete non circularly referred objects in precisely the order
they are now deleted in current Python. That order doesn't appear to
random for you, so I don't understand the above comment? As for circularly
referred data it will be deleted in the order determined by the collector,
but that's better than current Python which doesn't delete it at all.

Graham Matthews wrote:
> Why is it so hard for people to see that adding a mark sweep collector
> *ON TOP OF* the existing ref count scheme essentially changes nothing.
> All the current ref count behaviour that people love will stay. The
> only additional behaviour will be that circular refs are mopped up
> correctly.
Salvador =?iso-8859-1?Q?Fandi=F1o?= (fandino at usa.net) wrote:
: BTW, usual __del__ methods free resources like sockets, files, windows,
: etc. but they don't break circular references so calling __del__ will
: not free any object at all. 

Yes I know this. My point was that when the collector collects a circularly
referred object it can still call its __del__ *finaliser* just like now.
I was not suggestinf that __del__ be used to break circular refs.

graham
-- 
                  A cat named Easter
              He say "will you ever learn"
              Its just an empty cage girl
                 If you kill the bird




More information about the Python-list mailing list