Re:Compiler Warnings
by olliej on Friday January 25, 2019 @02:21PM
(#19001438)
Because python is broken in this respect -- JS engines do exactly the same object optimisations and get comparisons correct.
[ Parent
| on HN ]
Meh. They're different languages with different expectations. "is" is distinct from "==" in both, and Python gets "==" right (obviously). Javascript doesn't really have any high ground here[0]. (In contrast, Python:)
>>> [] == False
False
>>> object() == False
False
>>> "" == False
False
>>> {} == False
False
They're just different.