Out-of-range values are kept, and the Flag membership is kept. This is the default for IntFlag:
>>> from enum import Flag, KEEP, auto >>> class KeepFlag(Flag, boundary=KEEP): ... RED = auto() ... GREEN = auto() ... BLUE = auto() ... >>> KeepFlag(2**2 + 2**4) <KeepFlag.BLUE|16: 20>
enum/FlagBoundary.KEEP
FlagBoundary.KEEP