The joys of weakrefs... references to instance methods (callbacks)

Mike C. Fletcher mcfletch at geocities.com
Thu Feb 14 02:07:59 EST 2002


Hmm, short on time now to look at the code again.  dispatcher does 
include weak/strong switching IIRC.  Not critical for me at this point.

Would be nice to have a standard module for this stuff, eventually, but 
for now, I'll just stick with dispatcher (since it's already coded in). 
  Might look at AnyGUI's loop when I get around to re-writing 
OpenGLContext's event processing mechanisms.

Must run, enjoy,
Mike

Magnus Lie Hetland wrote:
> In article <mailman.1013502171.782.python-list at python.org>, Mike C.
> Fletcher wrote:
...
>>Also looked at the References.py module in anygui.  Didn't spend much 
>>time on it, as dispatcher is much closer to what I need.
>>
> 
> Take a look at References.py and Events.py together -- Events.py is
> the dispatcher part; References.py is just a set of utilities for
> references that can be either weak or strong.
> 
> 
>>Was one of 
>>these modules based on the other (your comments on the ASPN site seem to 
>>suggest there's some relationship)?
>>
> 
> Yes, the dispatcher in Anygui is based on this and at least two other
> similar dispatcher modules (but it is basically a full rewrite). There
> was some lengthy discussion on the Anygui devel list about this sort
> of dispatcher mechanism a while ago. (If you're interested, I could
> probably find the other two modules as well :)
> 
> One advantage of the Anygui dispatcher is that it allows you to use
> weak references for some handlers and strong references for others.
> (Maybe Patrick has also added that now -- I'm not sure.)
> 
> 
>>Good job all around. Thanks,
...





More information about the Python-list mailing list