title: Python, when override __eq__() in a new Class, strange thing happened
body: <p>I want to override the <strong>eq</strong> in a new Class A, the code are:</p>
  
  <pre><code>&gt;&gt;&gt; class A(object):
  ...     def __eq__(self, obj):
  ...         return True
  ...     
  
  &gt;&gt;&gt; a = A()
  
  &gt;&gt;&gt; b = A()
  
  &gt;&gt;&gt; L = [0, 0, a, 1]
  
  &gt;&gt;&gt; L.index(a)
  0
  
  &gt;&gt;&gt; L.index(0)
  0
  
  &gt;&gt;&gt; L.index(100)
  2
  
  &gt;&gt;&gt; L.index(1)
  2
  </code></pre>
  
  <p>It is hard to understand how did this happened.</p>