Skip to content

Commit

Permalink
Consolidate python examples in enum documentaiton
Browse files Browse the repository at this point in the history
The IntEnum example in the rst docs is the only example in which a
plural classname (Numbers) is used. This change fixes it by renaming
Numbers to Number.

Closes #104659
  • Loading branch information
twmr committed May 19, 2023
1 parent ac56a85 commit 90b8bb0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Doc/library/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down

0 comments on commit 90b8bb0

Please sign in to comment.