Skip to content

Commit b7a49eb

Browse files
gh-101739: [Enum] update docs - default boundary for Flag is CONFORM (GH-101746)
(cherry picked from commit 7f1c721) Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
1 parent be69ac3 commit b7a49eb

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Doc/library/enum.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,9 @@ Data Types
692692

693693
.. attribute:: STRICT
694694

695-
Out-of-range values cause a :exc:`ValueError` to be raised. This is the
696-
default for :class:`Flag`::
695+
Out-of-range values cause a :exc:`ValueError` to be raised::
697696

698-
>>> from enum import Flag, STRICT
697+
>>> from enum import Flag, STRICT, auto
699698
>>> class StrictFlag(Flag, boundary=STRICT):
700699
... RED = auto()
701700
... GREEN = auto()
@@ -710,9 +709,9 @@ Data Types
710709
.. attribute:: CONFORM
711710

712711
Out-of-range values have invalid values removed, leaving a valid *Flag*
713-
value::
712+
value. This is the default for :class:`Flag`::
714713

715-
>>> from enum import Flag, CONFORM
714+
>>> from enum import Flag, CONFORM, auto
716715
>>> class ConformFlag(Flag, boundary=CONFORM):
717716
... RED = auto()
718717
... GREEN = auto()
@@ -725,7 +724,7 @@ Data Types
725724
Out-of-range values lose their *Flag* membership and revert to :class:`int`.
726725
This is the default for :class:`IntFlag`::
727726

728-
>>> from enum import Flag, EJECT
727+
>>> from enum import Flag, EJECT, auto
729728
>>> class EjectFlag(Flag, boundary=EJECT):
730729
... RED = auto()
731730
... GREEN = auto()
@@ -735,10 +734,10 @@ Data Types
735734

736735
.. attribute:: KEEP
737736

738-
Out-of-range values are kept, and the *Flag* membership is kept. This is
739-
used for some stdlib flags:
737+
Out-of-range values are kept, and the *Flag* membership is kept. This is
738+
used for some stdlib flags::
740739

741-
>>> from enum import Flag, KEEP
740+
>>> from enum import Flag, KEEP, auto
742741
>>> class KeepFlag(Flag, boundary=KEEP):
743742
... RED = auto()
744743
... GREEN = auto()

0 commit comments

Comments
 (0)