Skip to content

Commit 0f31c74

Browse files
JulianKahnertMariatta
authored andcommitted
Improve enum.Flag code example (GH-5167)
The code example that demonstrate how to use enum.Flag was missing the import of enum.auto.
1 parent bca4218 commit 0f31c74

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/library/enum.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ value and let :class:`Flag` select an appropriate value.
654654
Like :class:`IntFlag`, if a combination of :class:`Flag` members results in no
655655
flags being set, the boolean evaluation is :data:`False`::
656656

657-
>>> from enum import Flag
657+
>>> from enum import Flag, auto
658658
>>> class Color(Flag):
659659
... RED = auto()
660660
... BLUE = auto()

0 commit comments

Comments
 (0)