problem with weakref.proxy

Walter Haslbeck news at badblocks.de
Sat Jan 31 14:19:36 EST 2004


Peter Otten <__peter__ at web.de> wrote:

> If you want to keep your original design, just use ref instead of proxy:

Thanks! Thats what I was looking for!

And: after I posted the original article I tried another method:

I didn't use weakref, but put a real reference of the instance
into __olist and checked in c_show_all with sys.getrefcount()
if the object is referenced by other names. If not, I removed
the object from __olist[].

Well, that worked. But I like the weakref.ref method much more!

Walter



More information about the Python-list mailing list