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

Function recursor

recipes/Python/491265_Automatic_Recursion/recipe-491265.py:42–48  ·  view source on GitHub ↗
(func, func_locals)

Source from the content-addressed store, hash-verified

40 return func(*args,**kwargs)
41
42def recursor(func, func_locals):
43 co=func.func_code
44 def _recursor(**kwargs):
45 args=tuple([kwargs.pop(co.co_varnames[i],func_locals[co.co_varnames[i]])
46 for i in range(co.co_argcount) ])
47 return func(*args,**kwargs)
48 return _recursor
49
50def recursor1(func):
51 # for recursion with some pre-computatation;

Callers 1

func2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected