foo = 'global' def method(foo): class A: print(foo) # from m1 import foo print(foo)