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

Method new_f

recipes/Python/523012_Recursionloop/recipe-523012.py:19–28  ·  view source on GitHub ↗
(*args, **kwds)

Source from the content-addressed store, hash-verified

17
18 def __call__(self, f):
19 def new_f(*args, **kwds):
20 id=args[an]
21 if id in self.cs:
22 #print "recursion detected at '%s' in %s" % (id, str(self.cs))
23 return defret
24 else:
25 self.cs.append(id)
26 x = f(*args, **kwds)
27 self.cs.remove(id)
28 return x
29 return new_f
30 return decorate()

Callers

nothing calls this directly

Calls 3

fFunction · 0.50
appendMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected