>>> class A(object): ... def __hash__(self): return 10**100 ... >>> class B(object): ... def __hash__(self): return hash(10**100) ... >>> class C(object): ... def __hash__(self): return 10 ... >>> a = A() >>> b = B() >>> c = C() >>> hash(a) == hash(b) True >>> hash(hash(a) ^ hash(c)) == hash(hash(b) ^ hash(c)) True >>> hash(a.__hash__() ^ c.__hash__()) == hash(b.__hash__() ^ c.__hash__()) False