]> granicus.if.org Git - python/commitdiff
Improve enum.Flag code example (GH-5167)
authorJulian Kahnert <mail@juliankahnert.de>
Sat, 13 Jan 2018 03:35:57 +0000 (04:35 +0100)
committerMariatta <Mariatta@users.noreply.github.com>
Sat, 13 Jan 2018 03:35:57 +0000 (19:35 -0800)
The code example that demonstrate how to use enum.Flag was missing
the import of enum.auto.

Doc/library/enum.rst

index 6548adf789da17e142b2581f49ee3bee10c687e2..5c1b226efc757d34dc04b3f8b69d85e7fa77d074 100644 (file)
@@ -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()