Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions Doc/library/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -696,10 +696,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()
Expand All @@ -715,9 +714,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()
Expand All @@ -731,7 +730,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()
Expand All @@ -742,10 +741,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()
Expand Down