Re:JavaScript: The Curious Case of null >= 0
by apenwarr on Saturday September 09, 2017 @10:44AM
(#15207295)
python 2 made a rational, well-considered choice, though I do like the python 3 replacement better. Despite its self-consistency, python 2 ended up causing hard-to-find errors (mostly when people accidentally compared "0" with 0 though; it mostly wasn't a problem with None).
In python 2, cross-type comparisons are strictly ordered. So:
>>> None == 0
False
>>> None < 0
True
>>> None <= 0
True
>>> None > 0
False
Completely consistent, no special cases, and if you sort() a list containing multiple types, it'll always come out in an unsurprising, consistent order.
Re:JavaScript: The Curious Case of null >= 0
by AlphaSite on Saturday September 09, 2017 @10:37AM
(#15207260)
Is this python 2 or python 3, afaik that was fixed in python 3.
Re:JavaScript: The Curious Case of null >= 0
by sdeframond on Saturday September 09, 2017 @10:43AM
(#15207286)
This error has been fixed in Python 3.
> I'll wait.
I don't write Python, but even so it took about 30 seconds, using the same area of the linked article as a starting point:
At this point, I fully expect some attempt at a post-hoc rationalization for why Python's choice here is unimpeachable.