[ZODB-Dev] [Problem] "_v_" variables too volatile

Gfeller Martin Martin.Gfeller at comit.ch
Thu Dec 11 12:16:33 EST 2003


> Date: Wed, 10 Dec 2003 13:29:35 -0500
> From: Jeremy Hylton <jeremy at zope.com>

> I agree that _v_ variables don't seem very useful if they can
disappear
> immediately after you assign to them, but in the current
implementation
> they don't, right?


Jeremy,

I'm using a _v_variable to keep a non-weak ref to a related object in a 
weak-key dict. The object in the dictionary should disappear whenever
the
object in the Zope cache disappears, and my dict should not prevent the
object
in the cache from being collected (i.e., not add to the refcount).

So a _v_variable with current semantics is exactely what I need. If the
cache
could not remove an object because of it's _v_variable, I would have to
find
another solution. 

So, it would break my code, but as long as there is a control, 
I can easily use that.

Best regards, 
Martin




More information about the ZODB-Dev mailing list