[Python-3000] PEP: Eliminate __del__

Raymond Hettinger python at rcn.com
Fri May 4 07:12:19 CEST 2007

From: "Greg Ewing" <greg.ewing at canterbury.ac.nz>
> It has nothing to do with cyclic GC. The point is that
> if the refcount of a weak reference drops to zero before
> that of the object being weakly referenced, the weak
> reference object itself is deallocated and its callback
> is *not* called. So having the resource-using object
> hold the weak ref to the resource doesn't work -- it
> has to be kept in some kind of separate registry.

I'll write-up an idiomaticc approach an include it in PEP this weekend.


More information about the Python-3000 mailing list