circuitpython/tests/basics/unboundlocal.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
242 B
Python
Raw Normal View History

# locals referenced before assignment
def f1():
print(x)
x = 1
def f2():
for i in range(0):
print(i)
print(i)
def check(f):
try:
f()
except NameError:
print("NameError")
check(f1)
check(f2)