Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7f1c721

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

File tree

Expand file treeCollapse file tree

1 file changed

+8
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-9
lines changed

‎Doc/library/enum.rst

Copy file name to clipboardExpand all lines: Doc/library/enum.rst
+8-9Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.