[issue40721] PEP0435 (enums) -- there is no standard on enum item letters case

Ethan Furman report at bugs.python.org
Sun Sep 13 16:56:52 EDT 2020


Ethan Furman <ethan at stoneleaf.us> added the comment:

For Python code at least, Guido has proclaimed:

https://mail.python.org/pipermail/python-ideas/2016-September/042340.html

I recommend naming all enums UPPER_CASE. They're constants (within a
namespace) and that's the rule for constants. It's helpful for the
reader of the code to realize what they are when passed around -- they
have a similar status to literal constants, you know they stand for a
unique value and not for some computed quantity.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40721>
_______________________________________


More information about the Python-bugs-list mailing list