[issue44242] enum.IntFlag regression: missing values cause TypeError

John Belmonte report at bugs.python.org
Wed May 26 17:59:26 EDT 2021


John Belmonte <john at neggie.net> added the comment:

> However, if the user is interfacing with other software/hardware, they may not have a choice on which bits make up the mask.

I think it's the same as saying "unknown bits may come on the input".  An important use case is for forward compatibility, where new bits may be added but you don't want to break existing code.

That is what CONFORM is for.  The cited code should either declare the masks as I've shown if STRICT is desired, or use CONFORM if forward compatibility is desired.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44242>
_______________________________________


More information about the Python-bugs-list mailing list