Python: Sharing global variables between modules and classes therein
This happens because you are using immutable values (ints and None), and importing variables is like passing things by value, not passing things by reference. If you made global_mod.x a list, and manipulated its first element, it would work as you expect. When you do from global_mod import x, you are creating a name x … Read more