class Anything: def __eq__(self, other): return True def __ne__(self, other): return False x = lambda: None print(x == Anything()) print(Anything() == x) y = object() print(y == Anything()) print(Anything() == y)