Python 2.0

Salvador Fandiño fandino at
Fri Jun 4 12:19:12 CEST 1999

Graham Matthews wrote:

> Salvador =?iso-8859-1?Q?Fandi=F1o?= (fandino at wrote:
> : GC usually deletes objects in random order which is not a very good
> : behavior.
> I am sorry but this comment is all myth.
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.

> 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.
I am just suggesting a way to improve the mark sweet collector you
talked about. Calling the __del__ method could be the default behavior
for it, but a new method hook could add better functionality...

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. 


More information about the Python-list mailing list