Removing circular references (was Re: Editors and books)

Cameron Laird claird at starbase.neosoft.com
Thu Apr 20 10:18:19 EDT 2000


In article <8dgbu7$k10$1 at slb6.atl.mindspring.net>,
Aahz Maruch <aahz at netcom.com> wrote:
>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.
			.
			.
			.
And, for completeness, I'll note that dangling circular
references are innocuous in many (most?) cases.  It's
only long-running processes with systematic memory leaks
which are generally worth concern.
-- 

Cameron Laird <claird at NeoSoft.com>
Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



More information about the Python-list mailing list