Arnaud Delobelle wrote: > Why not simply do: > > class YesNo(object): > def __init__(self, which): > self.yesno = which and self.yes or self.no > def yes(self, val): > print 'Yes', val > def no(self, val): > print 'No', val > def __call__(self, val): > self.yesno(val) > > I don't know which is fastest but I don't think there would be much > difference. > > -- > Arnaud >
This is more in the spirit of what I was trying to accomplish. Originally, I was unaware the __call__ could not be assigned a different method. -- http://mail.python.org/mailman/listinfo/python-list