]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40721: add note about enum member name case (GH-22231)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 14 Sep 2020 20:49:29 +0000 (13:49 -0700)
committerGitHub <noreply@github.com>
Mon, 14 Sep 2020 20:49:29 +0000 (13:49 -0700)
* UPPER_CASE preferred as enum members are constants
(cherry picked from commit 542e1df2b018ee7068dba8076f2d6e84efd6e144)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Doc/library/enum.rst

index 382db11a72ba6703086b8fc64bb6d5387c7260e2..5f0762edc25905c755c5cf7e9017e167d0eaf52d 100644 (file)
@@ -19,6 +19,12 @@ An enumeration is a set of symbolic names (members) bound to unique,
 constant values.  Within an enumeration, the members can be compared
 by identity, and the enumeration itself can be iterated over.
 
+.. note:: Case of Enum Members
+
+    Because Enums are used to represent constants we recommend using
+    UPPER_CASE names for enum members, and will be using that style
+    in our examples.
+
 
 Module Contents
 ---------------