(self, f)
| 3 | |
| 4 | class Curry: |
| 5 | def __init__(self, f): |
| 6 | self.hasv = f.func_code.co_flags & CO_VARARGS |
| 7 | self.hask = f.func_code.co_flags & CO_VARKEYWORDS |
| 8 | self.defaults = f.func_defaults or () |
| 9 | self.defnum = len(self.defaults) |
| 10 | self.f = f |
| 11 | self.argnum = f.func_code.co_argcount |
| 12 | self._reset() |
| 13 | def __call__(self, *a, **k): |
| 14 | if k and not self.hask: |
| 15 | raise TypeError, "%s got unexpected keyword argument '%s'" %\ |