No destructor

Martin von Loewis loewis at informatik.hu-berlin.de
Wed Aug 23 09:53:20 EDT 2000


> Aahz Maruch wrote:
> > While Python 2.0 will have a garbage collector, using it will be
> > strictly optional.

Ken Kinder <kkinder at tridog.com> writes:
> Actually, there is a patch for a Python garbage collector:
> http://www.enme.ucalgary.ca/~nascheme/python/gc.html
>
> It's not part of the standard Python distribution, but if you apply
> the patch it works pretty well.

Hmm. The patch you mention is part of the upcoming Python 2.0. This is
what Aahz said, and this is what the page you mention says...


> It does break things like
> 
> txt = open('foo').read()

How so? This code continues to work fine, with or without garbage
collector. In this example, the read method still has a reference to
the object, so it won't collect it.

Regards,
Martin




More information about the Python-list mailing list