1# test PEP 526, varible annotations 2 3x: int 4print("x" in globals()) 5 6x: int = 1 7print(x) 8 9t: tuple = 1, 2 10print(t) 11 12# a pure annotation in a function makes that variable local 13def f(): 14 x: int 15 try: 16 print(x) 17 except NameError: 18 print("NameError") 19f() 20 21# here, "x" should remain a global 22def f(): 23 x.y: int 24 print(x) 25f() 26