From 755ee2b53bf706a9f970d54cbc6b6fa3b5223330 Mon Sep 17 00:00:00 2001 From: "Filip \"Ret2Me\" Poplewski" <37419029+Ret2Me@users.noreply.github.com> Date: Fri, 1 Nov 2024 20:28:50 +0100 Subject: [PATCH] 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 --------- (cherry picked from commit ff257c7843d8ed0dffb6624f2f14996a46e74801) Co-authored-by: Filip "Ret2Me" Poplewski <37419029+Ret2Me@users.noreply.github.com> Co-authored-by: Ethan Furman --- Doc/library/enum.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index a724fe4bcdc723..2df9096c452761 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