summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFilip "Ret2Me" Poplewski <37419029+Ret2Me@users.noreply.github.com>2024-11-01 19:28:50 (GMT)
committerGitHub <noreply@github.com>2024-11-01 19:28:50 (GMT)
commitff257c7843d8ed0dffb6624f2f14996a46e74801 (patch)
tree53b96855d5bbf1359fc93bcd36e4c94f18a66248 /Doc
parent37651cfbce514a8daed75a8c63d6889081a63a23 (diff)
downloadcpython-ff257c7843d8ed0dffb6624f2f14996a46e74801.zip
cpython-ff257c7843d8ed0dffb6624f2f14996a46e74801.tar.gz
cpython-ff257c7843d8ed0dffb6624f2f14996a46e74801.tar.bz2
docs: add a more precise example in enum doc (GH-121015)
* docs: add a more precise example Previous example used manual integer value assignment in class based declaration but in functional syntax has been used auto value assignment what could be confusing for the new users. Additionally documentation doesn't show how to declare new enum via functional syntax with usage of the manual value assignment. * docs: remove whitespace characters * refactor: change example --------- Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/enum.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index 242b243..16a9b03 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -44,7 +44,7 @@ using function-call syntax::
... BLUE = 3
>>> # functional syntax
- >>> Color = Enum('Color', ['RED', 'GREEN', 'BLUE'])
+ >>> Color = Enum('Color', [('RED', 1), ('GREEN', 2), ('BLUE', 3)])
Even though we can use :keyword:`class` syntax to create Enums, Enums
are not normal Python classes. See