[Zope-dev] Zope Head (2.8) breaks "refresh"
Jeremy Hylton
jeremy at zope.com
Mon Dec 15 10:01:30 EST 2003
On Mon, 2003-12-15 at 07:34, Dieter Maurer wrote:
> >I don't think it makes a lot of sense to put an __del__ method on a
> >Persistent object.
>
> I just read in "cPersistence.c:ghostify":
>
> /* We remove the reference to the just ghosted object that the ring
> * holds. Note that the dictionary of oids->objects has an uncounted
> * reference, so if the ring's reference was the only one, this frees
> * the ghost object. Note further that the object's dealloc knows to
> * inform the dictionary that it is going away.
> */
>
> This means: *all* persistent objects have a special "dealloc"
> function. Hope, this "dealloc" function plays well with the
> cyclic garbage collector.
All Python objects have a "dealloc" function -- whatever is in the
tp_dealloc slot. The tp_dealloc function at the C level is completely
different from an __del__ method at the Python level.
Jeremy
More information about the Zope-Dev
mailing list