On Friday, Jan 24, 2003, at 11:50 Europe/Amsterdam, Jack Jansen wrote:
> On Friday, Jan 24, 2003, at 00:18 Europe/Amsterdam, Just van Rossum
>> Jack Jansen wrote:
>>> I'm not familiar enough with weak references, but I'm pretty sure
>>> signalling isn't part of its services, or is it? [ ... ]
>> I didn't know until now (after reading a bit), but it actually is!
>> a look:
>> Pretty cool! http://www.python.org/doc/current/lib/module-weakref.html
>> has the full scoop.
> I got all excited, but unfortunately careful reading of the cited
> revealed a problem: "if callback is provided it will be called when
> the object
> is about to be finalized, ..., the referent will no longer be
> available". In
> other words: when the callback is called we can't revive the referred
Why do you want to revive objects? The problem we're currently having
is that the proxy object gets deallocated while the Python object is
still alive. The weakref is only necessary to ensure that the proxy
stays alive as long as the Python object. I haven't checked this yet,
but this might be harder than I first thought: The proxy object calls
Py_INCREF in its init method, if we store proxy objects in a
datastructure we might keep the Python object alive indefinetly (e.g.