(x)
| 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) |