Skip to content

Commit

Permalink
pythongh-104659: Consolidate python examples in enum documentation (p…
Browse files Browse the repository at this point in the history
…ython#104665)

(cherry picked from commit 3ac856e)
  • Loading branch information
twmr authored and hugovk committed May 19, 2023
1 parent d78c3bc commit cc7d2bf
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Doc/library/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down

0 comments on commit cc7d2bf

Please sign in to comment.