No destructor

Alex Martelli alex at magenta.com
Tue Aug 22 17:14:57 EDT 2000


"spahievi" <spahievi at vega.bg> wrote in message
news:1541370114.20000822214659 at vega.bg...
> >> How does Python < 2.0 handle circular references?  Is the programmer
> >> expected to handle them via weak refs etc?
>
> AM> There are no 'weak references' in Python 1.5.2 (nor, I think, in 1.6).
> AM> Circular references need to be explicitly broken by the programmer,
> AM> else there will be a resource leak.
>
> There is extension module for weak dicts.

Not sure what you mean by 'weak dict'.  There's a snippet on the
Python snippets site, at URL:
http://tor.dhs.org/~zephyrfalcon/snippets/source/145.py
but I fail to see what it has to do with weak-references (or,
much of anything else).

If 'refhack' or other ways to provide weak references could be
standardized, that would surely be interesting (perhaps more
than optional GC as Python 2.0 provides...).


Alex






More information about the Python-list mailing list