Skip to content

Commit 79ff9b2

Browse files
committed
Consolidate python examples in enum documentation
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
1 parent ac56a85 commit 79ff9b2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Doc/library/enum.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,18 +406,18 @@ Data Types
406406
with an *IntEnum* member, the resulting value loses its enumeration status.
407407

408408
>>> from enum import IntEnum
409-
>>> class Numbers(IntEnum):
409+
>>> class Number(IntEnum):
410410
... ONE = 1
411411
... TWO = 2
412412
... THREE = 3
413413
...
414-
>>> Numbers.THREE
415-
<Numbers.THREE: 3>
416-
>>> Numbers.ONE + Numbers.TWO
414+
>>> Number.THREE
415+
<Number.THREE: 3>
416+
>>> Number.ONE + Number.TWO
417417
3
418-
>>> Numbers.THREE + 5
418+
>>> Number.THREE + 5
419419
8
420-
>>> Numbers.THREE == 3
420+
>>> Number.THREE == 3
421421
True
422422

423423
.. note::

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy