Removing circular references (was Re: Editors and books)

Aahz Maruch aahz at netcom.com
Mon Apr 17 20:57:43 EDT 2000


In article <20000417184833.H15664 at xs4all.nl>,
Thomas Wouters  <thomas at xs4all.net> wrote:
>
>The problem with RC is that you can create circular references:
>
>a = [some large list]
>b = [some other large list]
>a.append(b)
>b.append(a)
>
>del a
>del b

Note that you can break the circular reference if you do this between
the append and the del:

del a[-1]
del b[-1]

Similar tricks work in most other cases where circular references get
created.
--
                      --- Aahz (Copyright 2000 by aahz at netcom.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

"First one back from the bathroom gets to be the bottom."



More information about the Python-list mailing list