tuple weakref

Alex Martelli aleax at aleax.it
Sun Apr 13 23:56:25 CEST 2003

Martin v. Löwis wrote:

> Alex Martelli <aleax at aleax.it> writes:
>> The simplest solution is to have pyRXP return a tree of *LISTS*,
> Why is that a solution?
>>>> x=[]
>>>> import weakref
>>>> weakref.ref(x)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: cannot create weak reference to 'list' object

Sigh, you're right, it isn't -- lists aren't weakly referenceable
either!  Oh well...


More information about the Python-list mailing list