AST structures and memory leaks
Robin Becker
robin at jessikat.demon.co.uk
Thu Mar 16 03:28:37 EST 2000
I want to have an AST container A contain instances of B and would like
the instances to know who contains them, but can't seem to avoid memory
leaks.
The general structure is
class A:
def __init__(self):
self.list=[]
def add(self,b1):
self.list.append(b)
class B:
def __init__(self,owner):
self.owner=owner
a=A()
a.add(B(a))
which is clearly loopy :)
Is there any way to find the 'owner' of an instance?
--
Robin Becker
More information about the Python-list
mailing list