1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
# these should match
def f1():
global x
global y
def f3():
global x
global y
global z
def f4():
global x
global y
pass
global x
global y
def f2():
x = y = z = 1
def inner():
nonlocal x
nonlocal y
def inner2():
nonlocal x
nonlocal y
nonlocal z
def inner3():
nonlocal x
nonlocal y
pass
nonlocal x
nonlocal y
def f5():
w = x = y = z = 1
def inner():
global w
global x
nonlocal y
nonlocal z
def inner2():
global x
nonlocal y
nonlocal z
# these should not
def fx():
x = y = 1
def inner():
global x
nonlocal y
def inner2():
nonlocal x
pass
nonlocal y
def fy():
global x
pass
global y
def fz():
pass
global x
|