1# check that consts are not replaced in anything except standalone identifiers 2 3from micropython import const 4 5X = const(1) 6Y = const(2) 7Z = const(3) 8 9# import that uses a constant 10import micropython as X 11 12print(globals()["X"]) 13 14# function name that matches a constant 15def X(): 16 print("function X", X) 17 18 19globals()["X"]() 20 21# arguments that match a constant 22def f(X, *Y, **Z): 23 pass 24 25 26f(1) 27 28# class name that matches a constant 29class X: 30 def f(self): 31 print("class X", X) 32 33 34globals()["X"]().f() 35 36# constant within a class 37class A: 38 C1 = const(4) 39 40 def X(self): 41 print("method X", Y, C1, self.C1) 42 43 44A().X() 45