def test_dict_equality_lookup():
 class x(object, ):
  def __eq__(self, other):
   return False
  def __ne__(self, other):
   return True
 a = x()
 d = {}
 d[a] = 42
 AreEqual(d[a], 42)

def test_dict_equality_lookup ( ) : class x ( object , ) : def __eq__ ( self , other ) : return False def __ne__ ( self , other ) : return True a = x ( ) d = { } d [ a ] = 42 AreEqual ( d [ a ] , 42 )
dictionaries check object equality before running normal equality .