wemake-python-styleguide
wemake-python-styleguide copied to clipboard
Enforce constants to be SCREAMING_SNAKE_CASE
Rule request
Thesis
According to PEP-8:
Constants are usually defined on a module level and written in all capital letters with underscores separating words. Examples include MAX_OVERFLOW and TOTAL.
Examples:
# good
SOMETHING = 'hello'
def hello():
# good, not a global var
something = 'hello'
# good, not a constant
something = User()
# bad
something = 'hello'
PyLint has C0103 rule to validate it.
Reasoning
Follow PEP-8