Steven D'Aprano added the comment:
bools are integers, specifically they are a subclass of int:
py> isinstance(True, int)
True
py> issubclass(bool, int)
True
so the behaviour is correct.
--
nosy: +steven.daprano
resolution: -> not a bug
stage: -> resolved
status: open -> closed
__
New submission from John Rogers :
In Python Language Reference (version 3.7), section 6.9 it states that the
arguments of binary bitwise operators must be integers. However, the following
expressions work without error:
True & False
False | True
True ^ True
Each produces a boolea