In fact, Booleans and integers are the same. The only difference is in the string representations of 0 and 1, which, in the case of Booleans, is False and True, respectively. This allows constructions such as this:
def print_ispositive(x):
possibilities = ['nonpositive or zero', 'positive']
return f"x is {possibilities[x>0]}"
The last line in this example uses string formatting, which is explained in Section 2.4.3, String formatting.
We note for readers already familiar with the concept of subclasses that the type bool is a subclass of the type int (see Chapter 8: Classes). Indeed, all four inquiries – isinstance(True, bool), isinstance(False, bool), isinstance(True, int), and isinstance(False, int) return the value True (see Section 3.7, Checking the type of a variable).
Even rarely used statements such as True+13 are correct.