[Python-Dev] weak refs and jython

Samuele Pedroni Samuele Pedroni <pedroni@inf.ethz.ch>
Wed, 31 Jan 2001 13:34:32 +0100 (MET)


Hi.

I have read weak ref PEP, maybe too late.
I don't know if portability of code using weak refs between python and jython
was a goal or could be one, and up to which extent actual impl. will correspond 
to the PEP.

But about

    The callbacks registered with weak references must accept a single
    parameter, which will be the weak-ly referenced object itself.
    The object can be resurrected by creating some other reference to
    the object in the callback, in which case the weak reference
    generating the callback will still be cleared but no remaining
    weak references to the object will be cleared.
    
AFAIK using java weak refs (which I think is a natural choice) I see
no way (at least no worth-the-effort way) to implement this in jython.
Java weak refs cannot be resurrected.

regards, Samuele Pedroni.


PS: Mr. X  is a jython developer.