MCPcopy Index your code
hub / github.com/python/cpython / f

Method f

Lib/test/test_scope.py:101–107  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

99 def testNearestEnclosingScope(self):
100
101 def f(x):
102 def g(y):
103 x = 42 # check that this masks binding in f()
104 def h(z):
105 return x + z
106 return h
107 return g(2)
108
109 test_func = f(10)
110 self.assertEqual(test_func(5), 47)

Callers

nothing calls this directly

Calls 3

factFunction · 0.85
gFunction · 0.70
cClass · 0.70

Tested by

no test coverage detected