Why does `if None.__eq__("a")` seem to evaluate to True (but not quite)?
Why does `if None.__eq__("a")` seem to evaluate to True (but not quite)? Question: If you execute the following statement in Python 3.7, it will (from my testing) print b: if None.__eq__(“a”): print(“b”) However, None.__eq__(“a”) evaluates to NotImplemented. Naturally, “a”.__eq__(“a”) evaluates to True, and “b”.__eq__(“a”) evaluates to False. I initially discovered this when testing the return …
Total answers: 4