In PEP8, the general rule is to declare constants in UPPER_CASE chars. In real life, there can be a number of situations:
#!env python
DATABASE_HOST = 'localhost'
app = Flask('myapp')
base_two = partial(int, base=2)
Typically we consider string-type or numeric-type variables as immutable and thus constants, but not object or function. The problem is there is no-way a linter can do type-checking.
How do you deal with this case? Should I capitalize them or just disable this rule in my linter?
CONSTANT. Immutability of the value has nothing to do with the name.Constants are usually defined on a module level and written in all capital letters with underscores separating words. Examples include MAX_OVERFLOW and TOTAL