diff options
author | Ethan Furman <ethan@stoneleaf.us> | 2021-03-31 16:20:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-31 16:20:08 (GMT) |
commit | 49aec1a185bb2087fc4d846bd38d9150a357cfbd (patch) | |
tree | 729baea91e215ef0c1f73b9d880fdb9960155449 | |
parent | 202b54644245afadf124d8043688a95d4d9c456d (diff) | |
download | cpython-49aec1a185bb2087fc4d846bd38d9150a357cfbd.zip cpython-49aec1a185bb2087fc4d846bd38d9150a357cfbd.tar.gz cpython-49aec1a185bb2087fc4d846bd38d9150a357cfbd.tar.bz2 |
Enum: add (re)import of Flag for doctests (GH-25118)
Fix issue with CI doctest forgetting that ``Flag`` had already been imported.
-rw-r--r-- | Doc/library/enum.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index 3a6b2aa..bc88303 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -518,7 +518,7 @@ Data Types Out-of-range values cause a :exc:`ValueError` to be raised. This is the default for :class:`Flag`:: - >>> from enum import STRICT + >>> from enum import Flag, STRICT >>> class StrictFlag(Flag, boundary=STRICT): ... RED = auto() ... GREEN = auto() @@ -535,7 +535,7 @@ Data Types Out-of-range values have invalid values removed, leaving a valid *Flag* value:: - >>> from enum import CONFORM + >>> from enum import Flag, CONFORM >>> class ConformFlag(Flag, boundary=CONFORM): ... RED = auto() ... GREEN = auto() @@ -548,7 +548,7 @@ Data Types Out-of-range values lose their *Flag* membership and revert to :class:`int`. This is the default for :class:`IntFlag`:: - >>> from enum import EJECT + >>> from enum import Flag, EJECT >>> class EjectFlag(Flag, boundary=EJECT): ... RED = auto() ... GREEN = auto() @@ -561,7 +561,7 @@ Data Types Out-of-range values are kept, and the *Flag* membership is kept. This is used for some stdlib flags: - >>> from enum import KEEP + >>> from enum import Flag, KEEP >>> class KeepFlag(Flag, boundary=KEEP): ... RED = auto() ... GREEN = auto() |