Python considers a boolean as an integer. Why?
>>> boolean = True
>>> isinstance(boolean, int)
True
Reverse the condition and ask Python if an integer is a boolean (obviously no), you get this:
>>> integer = 123
>>> isinstance(integer, bool)
False