title: Why are booleans considered integers?
body: <p>Python considers a boolean as an integer. Why?</p>
  
  <pre><code>&gt;&gt;&gt; boolean = True
  &gt;&gt;&gt; isinstance(boolean, int)
  True
  </code></pre>
  
  <p>Reverse the condition and ask Python if an integer is a boolean (obviously no), you get this:</p>
  
  <pre><code>&gt;&gt;&gt; integer = 123
  &gt;&gt;&gt; isinstance(integer, bool)
  False
  </code></pre>