8000 bpo-40721: add note about enum member name case (GH-22231) · python/cpython@b502c76 · GitHub
[go: up one dir, main page]

Skip to content

Commit b502c76

Browse files
bpo-40721: add note about enum member name case (GH-22231)
* UPPER_CASE preferred as enum members are constants (cherry picked from commit 542e1df) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
1 parent bf7d4d0 commit b502c76

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Doc/library/enum.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ An enumeration is a set of symbolic names (members) bound to unique,
1919
constant values. Within an enumeration, the members can be compared
2020
by identity, and the enumeration itself can be iterated over.
2121

22+
.. note:: Case of Enum Members
23+
24+
Because Enums are used to represent constants we recommend using
25+
UPPER_CASE names for enum members, and will be using that style
26+
in our examples.
27+
2228

2329
Module Contents
2430
---------------

0 commit comments

Comments
 (0)
0