I\'m currently learning Python, and I have to work on a Python 2.7 project.
Accessing \"module scope\" variables in functions of the module itself is a bit confusing
Way 1 is the correct way when you absolutely must rebind a global variable. However you should ask yourself why you are modifying a global and whether there is something better you can do (such as encapsulating the behaviour in a class).
Importing a module into itself should be avoided as it is error prone. If the module is also a script you would sometimes need to import __main__ instead, or if the module is part of a package maybe you should be importing foo.my_module. In short, don't do that.