CPython 3.7.4
def test_nonlocal():
x = 0
y = 0
def f():
nonlocal x
nonlocal x, y
def test_nonlocal2():
x = 0
def f():
nonlocal x
nonlocal x
are OK.
RustPython gives SyntaxError: name 'x' is used prior to nonlocal declaration at line 0 column 0 for both of the examples.
CPython 3.7.4
are OK.
RustPython gives
SyntaxError: name 'x' is used prior to nonlocal declaration at line 0 column 0for both of the examples.