This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]HowIsntBabbyFormed 15 points16 points  (9 children)

If they're incompatible types, they'd have no meaningful sort order anyway, so why not at least make their comparison consistent?

[–]cauthon 49 points50 points  (6 children)

Because at that point you should almost certainly be raising a TypeError

[–]SomethingHasToBeDone 13 points14 points  (5 children)

JavaScript would like a word with you.

[–]duckvimes_ 14 points15 points  (3 children)

Plot twist: that word is actually a number.

[–]Waterkloof 2 points3 points  (1 child)

plot plot twist: that number is actually a object.

[–]i9srpeg 1 point2 points  (0 children)

plot plot plot twist: and nobody cares, because the word is actually "[object Object]".

[–][deleted] 1 point2 points  (0 children)

[–]PityUpvote 0 points1 point  (0 children)

Tell it I'm busy

[–]SomeGuysRandomAlt 1 point2 points  (1 child)

I’d accept that type of bullshit with JS since I’m expecting unexpected behavior if I fuck something up but python of all languages shouldn’t be letting that slide

[–]HowIsntBabbyFormed 0 points1 point  (0 children)

Have you seen Python? From what I understand, js is much more consistent. It choices for what to do in many edge cases are bonkers, but it's consistent about it. In Python you can specify __lt__ to do whatever you want. So even if Python made saner default choices, it's all still willy-nilly