I\'m receiving a Pylint error regarding my constant: MIN_SOIL_PARTICLE_DENS
(invalid name).
Any ideas why this constant is wrong? Here\'s my full function:
When checking names, Pylint differentiates between constants, variables, classes etc. Any name that is not inside a function/class will be considered a constant, anything else is a variable.
See http://docs.pylint.org/features.html#basic-checker
variable-rgx:
[a-z_][a-z0-9_]{2,30}$
const-rgx:
(([A-Z_][A-Z0-9_]*)|(__.*__))$
Because you're in a function, MIN_SOIL_PARTICLE_DENS
is (according to pylint) supposed to be a variable, pylint however treats it as a constant and therefore complains.
This means you can't have any uppercase names inside functions without pylint complaining.
If you ask me, using uppercase inside functions is fine; not all constants are necessarily defined globally.