title: Why is bool a subclass of int?
body: <p>When storing a bool in memcached through python-memcached I noticed that it's returned as an integer. Checking the code of the library showed me that there is a place where <code>isinstance(val, int)</code> is checked to flag the value as an integer.</p>
  
  <p>So I tested it in the python shell and noticed the following:</p>
  
  <pre><code>&gt;&gt;&gt; isinstance(True, int)
  True
  &gt;&gt;&gt; issubclass(bool, int)
  True
  </code></pre>
  
  <p>But why exactly is <code>bool</code> a subclass of <code>int</code>?</p>
  
  <p>It kind of makes sense because a boolean basically is an int which can just take two values but it needs much less operations/space than an actual integer (no arithmetics, only a single bit of storage space)....</p>