You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
433 B
26 lines
433 B
x:int = 1
|
|
y:int = 2
|
|
z:int = 3
|
|
|
|
def foo() -> object:
|
|
global x # OK
|
|
nonlocal y # No such nonlocal var
|
|
global w # No such global var
|
|
global int # No such global var
|
|
|
|
z:bool = True # OK
|
|
|
|
def bar() -> object:
|
|
global x # OK
|
|
nonlocal z # OK
|
|
nonlocal y # No such nonlocal var
|
|
global foo # No such global var
|
|
nonlocal bar # No such nonlocal var
|
|
|
|
pass
|
|
|
|
bar()
|
|
|
|
foo()
|
|
|