PyDocs

Nav

Data Types

FlagBoundary.STRICT

enum

attribute of FlagBoundary
Out-of-range values cause a ValueError to be raised. This is the default for Flag:
1 Example
>>> from enum import Flag, STRICT, auto
>>> class StrictFlag(Flag, boundary=STRICT):
...     RED = auto()
...     GREEN = auto()
...     BLUE = auto()
...
>>> StrictFlag(2**2 + 2**4)
Traceback (most recent call last):
...
ValueError: <flag 'StrictFlag'> invalid value 20
    given 0b0 10100
  allowed 0b0 00111
from the Python docs
See Also
No see-alsos for enum/FlagBoundary.STRICT
0 Notes
No notes for FlagBoundary.STRICT