On Tue, 09 Aug 2005 00:14:25 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: [...] >Here is a decorator object to set up function call dispatch according to type. >It only uses positional arguments, but could be fleshed out, I think. >Not tested beyond what you see ;-) > >----< typedispatcher.py >------------------------------------------------- ># typedispatcher.py [...] > assert len(set([f.func_name]+list(f.func_name for f in > self.dispdict.values()))) [...] Oops, that was a leftover hack that was supposed to check that all names were the same, and was missing ==1 at the right. Replaced by using self.name. Sorry. There's probably more, but the overall idea should be clear. Using **kw is also a leftover of starting down the trail of handling more signature variants, but I was too lazy.
Regards, Bengt Richter -- http://mail.python.org/mailman/listinfo/python-list