[Python-checkins] gh-101739: [Enum] update docs - default boundary for Flag is CONFORM (GH-101746)

miss-islington webhook-mailer at python.org
Fri Feb 17 16:44:52 EST 2023


https://github.com/python/cpython/commit/b7a49eb5ff541157a87fefb8fa0527a5cf2b3abc
commit: b7a49eb5ff541157a87fefb8fa0527a5cf2b3abc
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2023-02-17T13:44:45-08:00
summary:

gh-101739: [Enum] update docs - default boundary for Flag is CONFORM (GH-101746)

(cherry picked from commit 7f1c72175600b21c1c840e8988cc6e6b4b244582)

Co-authored-by: Owain Davies <116417456+OTheDev at users.noreply.github.com>

files:
M Doc/library/enum.rst

diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst
index 1973578e788c..180399938208 100644
--- a/Doc/library/enum.rst
+++ b/Doc/library/enum.rst
@@ -692,10 +692,9 @@ Data Types
 
    .. attribute:: STRICT
 
-      Out-of-range values cause a :exc:`ValueError` to be raised.  This is the
-      default for :class:`Flag`::
+      Out-of-range values cause a :exc:`ValueError` to be raised::
 
-         >>> from enum import Flag, STRICT
+         >>> from enum import Flag, STRICT, auto
          >>> class StrictFlag(Flag, boundary=STRICT):
          ...     RED = auto()
          ...     GREEN = auto()
@@ -710,9 +709,9 @@ Data Types
    .. attribute:: CONFORM
 
       Out-of-range values have invalid values removed, leaving a valid *Flag*
-      value::
+      value. This is the default for :class:`Flag`::
 
-         >>> from enum import Flag, CONFORM
+         >>> from enum import Flag, CONFORM, auto
          >>> class ConformFlag(Flag, boundary=CONFORM):
          ...     RED = auto()
          ...     GREEN = auto()
@@ -725,7 +724,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 Flag, EJECT
+         >>> from enum import Flag, EJECT, auto
          >>> class EjectFlag(Flag, boundary=EJECT):
          ...     RED = auto()
          ...     GREEN = auto()
@@ -735,10 +734,10 @@ Data Types
 
    .. attribute:: KEEP
 
-      Out-of-range values are kept, and the *Flag* membership is kept.  This is
-      used for some stdlib flags:
+      Out-of-range values are kept, and the *Flag* membership is kept. This is
+      used for some stdlib flags::
 
-         >>> from enum import Flag, KEEP
+         >>> from enum import Flag, KEEP, auto
          >>> class KeepFlag(Flag, boundary=KEEP):
          ...     RED = auto()
          ...     GREEN = auto()



More information about the Python-checkins mailing list