title: How can 2 objects be considered not equal and not identicial by Python, but have the same id?
body: <p>This code snippet is really puzzling me:</p>
  
  <pre><code>class O(object):
      pass
  O() == O()             # False
  O() is O()             # False
  hash(O()) == hash(O()) # True !
  id(O()) == id(O())     # True !!!
  </code></pre>
  
  <p>I always thought that the <code>is</code> operator was comparing <code>id</code>s, and that the default instance equality check (<code>==</code>) also compared <code>id</code>s, or at least <code>hash</code>es:</p>
  
  <ul>
  <li><p><a href="https://docs.python.org/2/reference/expressions.html#not-in" rel="nofollow"><code>x is y</code> is true if and only if x and y are the same object</a></p></li>
  <li><p><a href="https://docs.python.org/2/reference/datamodel.html#object.__cmp__" rel="nofollow">If no <code>__cmp__()</code>, <code>__eq__()</code> or <code>__ne__()</code> operation is defined, class instances are compared by object identity (“address”)</a></p></li>
  </ul>
  
  <p>How can 2 class instances share the same <code>id</code>, but not be equal in any way ??</p>
  
  <p>I'm using CPython 2.7.6.</p>