1def Fun(): 2 pass 3 4class A: 5 def __init__(self): 6 pass 7 def Fun(self): 8 pass 9 10try: 11 print(Fun.__name__) 12 print(A.__init__.__name__) 13 print(A.Fun.__name__) 14 print(A().Fun.__name__) 15except AttributeError: 16 print('SKIP') 17 raise SystemExit 18 19# __name__ of a bound native method is not implemented in uPy 20# the test here is to make sure it doesn't crash 21try: 22 str((1).to_bytes.__name__) 23except AttributeError: 24 pass 25 26# name of a function that has closed over variables 27def outer(): 28 x = 1 29 def inner(): 30 return x 31 return inner 32print(outer.__name__) 33