gh-103365: [Enum] STRICT boundary corrections (GH-103494)

STRICT boundary:

- fix bitwise operations
- make default for Flag
This commit is contained in:
Ethan Furman 2023-04-13 08:24:33 -07:00 committed by GitHub
parent efb8a2553c
commit 2194071540
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 82 additions and 38 deletions

View file

@ -696,7 +696,8 @@ Data Types
.. attribute:: STRICT
Out-of-range values cause a :exc:`ValueError` to be raised::
Out-of-range values cause a :exc:`ValueError` to be raised. This is the
default for :class:`Flag`::
>>> from enum import Flag, STRICT, auto
>>> class StrictFlag(Flag, boundary=STRICT):
@ -714,7 +715,7 @@ Data Types
.. attribute:: CONFORM
Out-of-range values have invalid values removed, leaving a valid *Flag*
value. This is the default for :class:`Flag`::
value::
>>> from enum import Flag, CONFORM, auto
>>> class ConformFlag(Flag, boundary=CONFORM):