O'Reilly logo
  • Chris Kang thinks this is interesting:

When a statement in the module body binds a (global) variable, what gets bound is an attribute of the module object.

From

Cover of Python in a Nutshell, 3rd Edition

Note

This is why you need to use the module to access its variables: myModule.moduleGlobalVar. The global variable of the imported module does not become global module of current name space.