[Python-3000] PEP: Eliminate del (original) (raw)
Raymond Hettinger python at rcn.com
Fri May 4 07:12:19 CEST 2007
- Previous message: [Python-3000] PEP: Eliminate __del__
- Next message: [Python-3000] PEP: Eliminate __del__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
Raymond
- Previous message: [Python-3000] PEP: Eliminate __del__
- Next message: [Python-3000] PEP: Eliminate __del__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]