mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
Improve enum.Flag code example (GH-5167)
The code example that demonstrate how to use enum.Flag was missing the import of enum.auto.
This commit is contained in:
parent
bca42186b6
commit
0f31c74fcf
1 changed files with 1 additions and 1 deletions
|
|
@ -654,7 +654,7 @@ value and let :class:`Flag` select an appropriate value.
|
|||
Like :class:`IntFlag`, if a combination of :class:`Flag` members results in no
|
||||
flags being set, the boolean evaluation is :data:`False`::
|
||||
|
||||
>>> from enum import Flag
|
||||
>>> from enum import Flag, auto
|
||||
>>> class Color(Flag):
|
||||
... RED = auto()
|
||||
... BLUE = auto()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue