3 ms·
> And 0 == False, "" != False, but both 0 and "" are considered false? Also, 1 == True, "x" != True, but both 1 and "x" are considered true. I don't quite unde
by tomp 13y ago
> And 0 == False, "" != False, but both 0 and "" are considered false?
Also, 1 == True, "x" != True, but both 1 and "x" are considered true. I don't quite understand why you find this so surprising.
The most problematic thing here, IMO, is that bool is a subtype of int in Python.