On Thu, 17 May 2012 08:10:40 -0700
Ethan Furman <
ethan@stoneleaf.us> wrote:
> From the manual [8.11]:
>
> > A weak reference to an object is not enough to keep the object alive:
> > when the only remaining references to a referent are weak references,
> > garbage collection is free to destroy the referent and reuse its
> > memory for something else.
>
> This leads to a difference in behaviour between CPython and the other
> implementations: CPython will (currently) immediately destroy any
> objects that only have weak references to them with the result that
> trying to access said object will require making a new one;
This is only true if the object isn't caught in a reference cycle.