micropython/tests/basics/del_deref.py

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

23 lines
352 B
Python
Raw Normal View History

def f():
x = 1
y = 2
def g():
nonlocal x
print(y)
try:
print(x)
except NameError:
print("NameError")
def h():
nonlocal x
print(y)
try:
del x
except NameError:
print("NameError")
print(x, y)
del x
g()
h()
f()