MCPcopy Create free account
hub / github.com/ActiveState/code / __init__

Method __init__

recipes/Python/52564_Curried_functions/recipe-52564.py:5–12  ·  view source on GitHub ↗
(self, f)

Source from the content-addressed store, hash-verified

3
4class 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'" %\

Callers

nothing calls this directly

Calls 1

_resetMethod · 0.45

Tested by

no test coverage detected