I am trying to understand why pylint treats module-level global variables as constants when checking the validity of their names. I though pylint followed PEP8 but if I look here: https://www.python.org/dev/peps/pep-0008/#id42 I see that global variables should follow the same format as function names (with some caveats about beginning with a "_" or being protected by __all__).

Is the problem that it is difficult to determine whether a module-level variable is a constant or a global variable, so it was decided to err on the side of constants since use of global variables is generally discouraged and the invalid-name check can be locally disabled for the few global variables that are needed?

Will