Skip to content

Commit 7f1c721

Browse files
authored
gh-101739: [Enum] update docs - default boundary for Flag is CONFORM (GH-101746)
1 parent 77d95c8 commit 7f1c721

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
@@ -696,10 +696,9 @@ Data Types
696696

697697
.. attribute:: STRICT
698698

699-
Out-of-range values cause a :exc:`ValueError` to be raised. This is the
700-
default for :class:`Flag`::
699+
Out-of-range values cause a :exc:`ValueError` to be raised::
701700

702-
>>> from enum import Flag, STRICT
701+
>>> from enum import Flag, STRICT, auto
703702
>>> class StrictFlag(Flag, boundary=STRICT):
704703
... RED = auto()
705704
... GREEN = auto()
@@ -715,9 +714,9 @@ Data Types
715714
.. attribute:: CONFORM
716715

717716
Out-of-range values have invalid values removed, leaving a valid *Flag*
718-
value::
717+
value. This is the default for :class:`Flag`::
719718

720-
>>> from enum import Flag, CONFORM
719+
>>> from enum import Flag, CONFORM, auto
721720
>>> class ConformFlag(Flag, boundary=CONFORM):
722721
... RED = auto()
723722
... GREEN = auto()
@@ -731,7 +730,7 @@ Data Types
731730
Out-of-range values lose their *Flag* membership and revert to :class:`int`.
732731
This is the default for :class:`IntFlag`::
733732

734-
>>> from enum import Flag, EJECT
733+
>>> from enum import Flag, EJECT, auto
735734
>>> class EjectFlag(Flag, boundary=EJECT):
736735
... RED = auto()
737736
... GREEN = auto()
@@ -742,10 +741,10 @@ Data Types
742741

743742
.. attribute:: KEEP
744743

745-
Out-of-range values are kept, and the *Flag* membership is kept. This is
746-
used for some stdlib flags:
744+
Out-of-range values are kept, and the *Flag* membership is kept. This is
745+
used for some stdlib flags::
747746

748-
>>> from enum import Flag, KEEP
747+
>>> from enum import Flag, KEEP, auto
749748
>>> class KeepFlag(Flag, boundary=KEEP):
750749
... RED = auto()
751750
... GREEN = auto()

0 commit comments

Comments
 (0)