STRICT, CONFORM, EJECT, KEEP = FlagBoundary
-class Flag(Enum, boundary=STRICT):
+class Flag(Enum, boundary=CONFORM):
"""
Support for flags
"""
self.assertEqual(bool(f.value), bool(f))
def test_boundary(self):
- self.assertIs(enum.Flag._boundary_, STRICT)
+ self.assertIs(enum.Flag._boundary_, CONFORM)
class Iron(Flag, boundary=STRICT):
ONE = 1
TWO = 2
--- /dev/null
+fix Flag to use boundary CONFORM\r
+\r
+This restores previous Flag behavior of allowing flags with non-sequential values to be combined; e.g.\r
+\r
+ class Skip(Flag):\r
+ TWO = 2\r
+ EIGHT = 8\r
+\r
+ Skip.TWO | Skip.EIGHT -> <Skip.TWO|EIGHT: 10>