[Python-Dev] reference leaks, del, and annotations (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Apr 4 05:45:58 CEST 2006


Tim Peters wrote:

We already endure lots of pain to ensure that a weakref callback that gets executed (not all do) can't see anything that looks like trash.

Okay, so would it be possible for a generator that needs finalisation to set up a weakref callback, suitably rooted somewhere so that the callback is reachable, that references enough stuff to clean up after the generator, without referencing the generator itself?

-- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | Carpe post meridiam! | Christchurch, New Zealand | (I'm not a morning person.) | greg.ewing at canterbury.ac.nz +--------------------------------------+



More information about the Python-Dev mailing list