Add no binding found for nonlocal issue

This commit is contained in:
Dave Halter
2017-07-30 21:33:26 +02:00
parent aa0225f63f
commit 0906c0b634
4 changed files with 49 additions and 12 deletions

View File

@@ -175,10 +175,30 @@ FAILING_EXAMPLES = [
'''),
dedent('''
def x():
global a
nonlocal a
a = 4
def y():
global a
nonlocal a
'''),
# Missing binding of nonlocal
dedent('''
def x():
nonlocal a
'''),
dedent('''
def x():
def y():
nonlocal a
'''),
dedent('''
def x():
a = 4
def y():
global a
print(a)
def z():
nonlocal a
'''),