Have you used Python a lot? That's not how it works. Python is not weakly typed and
"string" + 5
throws an exception.
"string" + 5
throws an exception.
if some_bool == 1
or if isinstance(some_bool, int)
written before the bool type was added (which only happened 2.3)I have powerful dislike for code like the future version of the above, i.e.
if some_bool == True
since that, in my mind's machine, just generates a bool result, which then (in the logic of the code) must be compared to True. If the result of == doesn't have to be compared, then why does some_bool? It's brutally inconsistent and fantastically annoying.Unfortunately, to many programmers it's also second nature to write such comparisons. Gaah. :(
You could try removing Eq, Ord and TotalOrd from Rust's bool and see what breaks.
Sounds like a way to make XOR be a big pain.
Or do you only want to ban comparing to literals? It can make things clearer to write something like "if bool==false" rather than "if not bool", especially when double negatives get involved.
Only ban comparing to literal true? Sure, go for it. But then the language is more complex for no real benefit.