|
From: Mike C. F. <mcf...@ro...> - 2005-09-22 21:42:30
|
Nitro wrote:
> Hello,
>
> I am new to PyDispatcher and thus read through simple_sample.py.
> There's a line like
>
> DO_SOMETHING = ('THIS','IS','A','MORE','COMPLEX','SIGNAL')
>
> in it. Are there any places where such a "strange" signal is actually
> useful? Till now I've used just integers to designate each event, now
> I switched over to sth like this
>
> def new_event(name):
> setattr(__module__, name, name)
>
> new_event('TestEvt')
> ...
>
> What's your way to deal with defining signals? I am not sure if this
> is the right place to discuss PyDispatcher, however, the sourceforge
> forums were empty, so I asked here.
Complex signals are quite useful when you want more complex behaviour ;)
. For instance, where you want a signal to be able to find all of its
parent signals. That said, they're more of an easy-to-provide feature
than a must-have-it feature. I happen to define all of my signals as
instances of classes with pretty-printing names and that kind of thing,
but that's hardly the *most* useful thing you can do with it.
For PyDispatcher discussion this is the right place,
Mike
--
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com
|