If you execute the following statement in Python 3.7, it will (from my testing) print b
:
if None.__eq__(\"a\"):
print(\"b\")
As you already figured None.__eq__("a")
evaluates to NotImplemented
however if you try something like
if NotImplemented:
print("Yes")
else:
print("No")
the result is
yes
this mean that the truth value of NotImplemented
true
Therefor the outcome of the question is obvious:
None.__eq__(something)
yields NotImplemented
And bool(NotImplemented)
evaluates to True
So if None.__eq__("a")
is always True