aboutsummaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorHugo van Kemenade <hugovk@users.noreply.github.com>2023-05-19 23:12:57 +0300
committerGitHub <noreply@github.com>2023-05-19 23:12:57 +0300
commitcd13f73afd042fddbb4c85a4b0466276e1d53735 (patch)
tree07409530d1fdf6bd06f0fac168bd5bc827651f5e /Doc
parent7b3bc95067b118b31e9781d460b41bf0cd629aab (diff)
downloadcpython3-cd13f73afd042fddbb4c85a4b0466276e1d53735.tar.gz
[3.11] gh-104659: Consolidate python examples in enum documentation (#104665) (#104666)
gh-104659: Consolidate python examples in enum documentation (#104665) (cherry picked from commit 3ac856e69734491ff8423020c700c9ae86ac9a08) Co-authored-by: Thomas Hisch <t.hisch@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/enum.rst13
1 files changed, 7 insertions, 6 deletions
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index 27400cf993..15b8e2918d 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -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::