On Friday 23 January 2004 17:08, Tim Peters wrote:

> It looks like ghostifying your "self" triggers self.__del__().  Then the
> __del__ method unghostifies self, which has the side effect of moving self
> to the MRU end of the ring, which in turn means the list traversal will
> visit self *again*.  When it does, same thing happens all over again, ad
> infinitum.

Not necessaralily ad infinitum. It will only run forever if the number of 
__del__-resurrecting objects in the cache is larger than the cache target 
size. Does that fit with your scenario?

> 2. If you need a __del__ method (it's hard to imagine why, since it
>    will get called whenever the object is ghostified, and has nothing
>    to do with the object's actual lifetime), don't reference any
>    persistent objects (and esp. not self) within it.

or 2b as jeremy suggested, put your __del__ on a non-persistent sub object.

-- 
Toby Dickenson


_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to