Skip to content

Commit e898f39

Browse files
author
Nacho Caballero
committed
fix the example
1 parent fd84e42 commit e898f39

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

Doc/library/enum.rst

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -509,21 +509,19 @@ Data Types
509509
of any string operation performed on or with a *StrEnum* member is not part
510510
of the enumeration.
511511

512-
>>> from enum import StrEnum
513-
>>> class Color(StrEnum):
514-
... RED = 'r'
515-
... GREEN = 'g'
516-
... BLUE = 'b'
517-
... UNKNOWN = auto()
518-
...
519-
>>> Color.RED
520-
<Color.RED: 'r'>
521-
>>> str(Color.RED)
522-
'r'
523-
>>> Color.UNKNOWN
524-
<Color.UNKNOWN: 'unknown'>
525-
>>> str(Color.UNKNOWN)
526-
'unknown'
512+
>>> from enum import StrEnum, auto
513+
>>> class Color(StrEnum):
514+
... RED = 'r'
515+
... GREEN = 'g'
516+
... BLUE = 'b'
517+
... UNKNOWN = auto()
518+
...
519+
>>> Color.RED
520+
<Color.RED: 'r'>
521+
>>> Color.UNKNOWN
522+
<Color.UNKNOWN: 'unknown'>
523+
>>> str(Color.UNKNOWN)
524+
'unknown'
527525

528526
.. note::
529527

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