title: Is False == 0 and True == 1 an implementation detail or is it guaranteed by the language?
body: <p>Is it guaranteed that <code>False == 0</code> and <code>True == 1</code>, in Python (assuming that they are not reassigned by the user)?  For instance, is it in any way guaranteed that the following code will always produce the same results, whatever the version of Python (both existing and, likely, future ones)?</p>
  
  <pre><code>0 == False  # True
  1 == True   # True
  ['zero', 'one'][False]  # is 'zero'
  </code></pre>
  
  <p>Any reference to the official documentation would be much appreciated!</p>
  
  <p><strong>Edit</strong>: As noted in many answers, <code>bool</code> inherits from <code>int</code>.  The question can therefore be recast as: "Does the documentation officially say that programmers can rely on booleans inheriting from integers, <em>with the values <code>0</code> and <code>1</code></em>?".  This question is relevant for writing robust code that won't fail because of implementation details!</p>