Is this..... evil?
Jeff Shannon
jeff at ccvcorp.com
Mon Feb 11 16:58:13 EST 2002
Joshua Muskovitz wrote:
> My suggestion would be for each type of receiver to simply create its own
> dict which maps message types (strings) to local functions. ...
> [--------------snip---------------]
> class F(Receiver):
> def __init__(self):
> Receiver.__init__(self)
> self.msgFuncs['fighto'] = rec_fighto
I believe you'd need that last line to be
self.msgFuncs['fighto'] = self.rec_fighto
But otherwise this ought to work. (Which might or might not be the same thing
as being the appropriate solution, but that's for the O.P. to decide. ;) )
Jeff Shannon
Technician/Programmer
Credit International
More information about the Python-list
mailing list