Commit 0f31c74f authored by Julian Kahnert's avatar Julian Kahnert Committed by Mariatta

Improve enum.Flag code example (GH-5167)

The code example that demonstrate how to use enum.Flag was missing
the import of enum.auto.
parent bca42186
...@@ -654,7 +654,7 @@ value and let :class:`Flag` select an appropriate value. ...@@ -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 Like :class:`IntFlag`, if a combination of :class:`Flag` members results in no
flags being set, the boolean evaluation is :data:`False`:: flags being set, the boolean evaluation is :data:`False`::
>>> from enum import Flag >>> from enum import Flag, auto
>>> class Color(Flag): >>> class Color(Flag):
... RED = auto() ... RED = auto()
... BLUE = auto() ... BLUE = auto()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment