]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-104659: Consolidate python examples in enum documentation (#104665) (#104666)
authorHugo van Kemenade <hugovk@users.noreply.github.com>
Fri, 19 May 2023 20:12:57 +0000 (23:12 +0300)
committerGitHub <noreply@github.com>
Fri, 19 May 2023 20:12:57 +0000 (23:12 +0300)
gh-104659: Consolidate python examples in enum documentation (#104665)

(cherry picked from commit 3ac856e69734491ff8423020c700c9ae86ac9a08)

Co-authored-by: Thomas Hisch <t.hisch@gmail.com>
Doc/library/enum.rst

index 27400cf993c092205ca375aac8cf0126136775b5..15b8e2918d754437026f9d1fa4c5787178661b9e 100644 (file)
@@ -404,17 +404,18 @@ Data Types
    with an *IntEnum* member, the resulting value loses its enumeration status.
 
       >>> from enum import IntEnum
-      >>> class Numbers(IntEnum):
+      >>> class Number(IntEnum):
       ...     ONE = 1
       ...     TWO = 2
       ...     THREE = 3
-      >>> Numbers.THREE
-      <Numbers.THREE: 3>
-      >>> Numbers.ONE + Numbers.TWO
+      ...
+      >>> Number.THREE
+      <Number.THREE: 3>
+      >>> Number.ONE + Number.TWO
       3
-      >>> Numbers.THREE + 5
+      >>> Number.THREE + 5
       8
-      >>> Numbers.THREE == 3
+      >>> Number.THREE == 3
       True
 
    .. note::