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

Марк Коренберг report at bugs.python.org
Thu May 21 17:42:56 EDT 2020


New submission from Марк Коренберг <socketpair at gmail.com>:

Example from PEP0435:

(https://www.python.org/dev/peps/pep-0435)

>>> from enum import Enum
>>> class Color(Enum):
...     red = 1
...     green = 2
...     blue = 3

Example from Python documentation:

(https://docs.python.org/3/library/enum.html)

>>> from enum import Enum
>>> class Color(Enum):
...     RED = 1
...     GREEN = 2
...     BLUE = 3
...

So, what are the rules for naming enum members?
CamelCase ? snake_case ? ALL_CAPS ?

Someone should explain how should we format sources. So various linters may check for that.

----------
assignee: docs at python
components: Documentation
messages: 369544
nosy: docs at python, socketpair
priority: normal
severity: normal
status: open
title: PEP0435 (enums) -- there is no standard on enum item letters case
versions: Python 3.10, Python 3.8, Python 3.9

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


More information about the New-bugs-announce mailing list