[code-quality] Valid global and constant names

Will S wsha.code at gmail.com
Fri Aug 26 17:42:02 EDT 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/code-quality/attachments/20160826/82dc5aec/attachment.html>


More information about the code-quality mailing list