Lichen

Annotated tests/nested_bad_python.py

2:3dff1f10598f
2016-08-30 Paul Boddie Added tests from PythonLight.
paul@2 1
a = 4
paul@2 2
paul@2 3
def f(x):
paul@2 4
    def g():
paul@2 5
        def h(z):
paul@2 6
            return x, y, z, a
paul@2 7
        h(3)  # NameError in Python
paul@2 8
        y = 2 # not available for h, detected during inspection
paul@2 9
        return h
paul@2 10
    return g
paul@2 11
paul@2 12
result = f(1)()(3)
paul@2 13
assert result == (1, 2, 3, 4)