__peter__ at web.de
Fri Dec 19 16:14:21 CET 2008
>> either. I'd suggest a plain-python workaround along the lines of
> Wow. You just blew my mind. I'm going to play with this. Thanks a
> lot, I've really learned a lot in just that small bit. I don't have
> much experience in playing with a lot of the 'private' calls such as
> __call__. I need to do some more reading.
Here's a non-OO variant:
funcs = 
for f in list(funcs): # *
I does the same, but is a bit harder to manage if you have more than one
event/widget to deal with.
(*) iterating over a copy of the list of functions is slightly more robust
as it will not accidentally skip callbacks when the original list is
modified during iteration. I suggest that you change the OO version
More information about the Python-list