Should Class-specific "constants" Still Be Declared At Module Level?
In PEP 8, it's stated that 'Constants are usually defined on a module level […]'. This makes sense for the standard library, where constants tend to pertain to the entire module
Solution 1:
Clearly, class-based constants belong in the class. Stick with your second example. Remember PEP8 is not handed down from the Almighty. It's just good ideas: tradition, reason and experience can temper the meaning of scripture.
Hungrarian_prefix_notation is needless. That's one reason you have classes.
Post a Comment for "Should Class-specific "constants" Still Be Declared At Module Level?"