# HG changeset patch # User aurelien@trantor.local # Date 1258924140 -3600 # Sun Nov 22 22:09:00 2009 +0100 # Node ID 74885982e3160261b2b214142029f86afb8ae30a # Parent 45d72af2b420a52e684edfc287a89377071898a5 remove tuple around function in func table diff --git a/dispatch.py b/dispatch.py --- a/dispatch.py +++ b/dispatch.py @@ -27,14 +27,14 @@ self._pos = 0 self._funcs = self.linearized_table(sig) if sig not in self._cache: - func = self._funcs.pop()[0] + func = self._funcs.pop() self._cache[sig] = func else: func = self._cache[sig] return func(*args) def next_method(self, *args): - func = self._funcs.pop()[0] + func = self._funcs.pop() return func(*args) def linearized_table(self, sig): @@ -45,6 +45,6 @@ def nomatch(*a): raise TypeError('no defined call signature <%s> for args (%s)' % (','.join([str(o) for o in sig]), a)) - return [(nomatch,)] - return map(lambda l:l[1:], lexicographic_mro(sig, table)) + return [nomatch] + return map(lambda l:l[1], lexicographic_mro(sig, table))