[Python-checkins] gh-104659: Consolidate python examples in enum documentation (#104665)
hugovk
webhook-mailer at python.org
Fri May 19 13:46:28 EDT 2023
https://github.com/python/cpython/commit/3ac856e69734491ff8423020c700c9ae86ac9a08
commit: 3ac856e69734491ff8423020c700c9ae86ac9a08
branch: main
author: Thomas Hisch <t.hisch at gmail.com>
committer: hugovk <hugovk at users.noreply.github.com>
date: 2023-05-19T11:46:20-06:00
summary:
gh-104659: Consolidate python examples in enum documentation (#104665)
files:
M Doc/library/enum.rst
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index 582e06261afd..e9c4f0e2c5f5 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -406,18 +406,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::
More information about the Python-checkins
mailing list