4 ms·
This is neat. My first reaction was confusion and a bit of shock. But then it made sense. And it makes a lot of sense. Part of the issue is that “==“ and “is”
by koliber 6y ago
This is neat. My first reaction was confusion and a bit of shock. But then it made sense. And it makes a lot of sense.
Part of the issue is that “==“ and “is” are intermixed. That emphasizes the weirdness but detracts from understanding the underlying mechanism that is at work.
If you look at
True == False == False
It makes more a bit sense that it evaluates the way it does.
If you do
1 == 2 == 2
and it evaluates to False, then it is perfectly clear.