Re: [Python-3000] weakrefs and cyclic references

2006-06-02 Thread tomer filiba
dang, you posted before me :) anyway, please check my implementation as well http://sebulba.wikispaces.com/recipe+weakattr i also included some demos. anyway, i'd like to have this or the other weakattr implementation included in weakref.py. it's a pretty useful feature to have in the stdlib, fo

Re: [Python-3000] weakrefs and cyclic references

2006-06-02 Thread Nick Coghlan
Greg Ewing wrote: > What might be useful is an easier way of *explicitly* > creating and using weak references. > > We already have WeakKeyDictionary and WeakValueDictionary > which behave just like ordinary dicts except that they > weakly reference things. I'm thinking it would be nice > to have

Re: [Python-3000] weakrefs and cyclic references

2006-06-01 Thread Greg Ewing
tomer filiba wrote: > you can solve the problem using > weakref.proxy > ... > so why not do this automatically? I would *not* want to have some of my references chosen at random and automatically made into weak ones. I may temporarily create a cycle and later break it by removing one of the refer

Re: [Python-3000] weakrefs and cyclic references

2006-05-31 Thread Josiah Carlson
"tomer filiba" <[EMAIL PROTECTED]> wrote: > the current gc already detects cyclic referencing between objects, > and by what i understood, it can free the memory the objects take, > but __del__ is never call because there's not telling where to > start the __del__ chain. Not all cyclic references

[Python-3000] weakrefs and cyclic references

2006-05-31 Thread tomer filiba
the current gc already detects cyclic referencing between objects, and by what i understood, it can free the memory the objects take,but __del__ is never call because there's not telling where tostart the __del__ chain. by cyclic referencing i mean something like>>> class x(object):... def __in