Python has inplace operators such as -=
and |=
for arithmetic and bit operations:
FLAG_FOO = 1 << 0
FLAG_BAR = 1 << 1
mask = FLAG_FOO
mask |= FLAG_BAR
assert mask == 3 == FLAG_FOO | FLAG_BAR
Is there an equivalent for actual True
/False
Booleans?