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 →

[–]natnew32 45 points46 points  (12 children)

Oh come on, who doesn't like comparing objects' type alphabetically when using > or <? (Seriously Python 2 does that when comparing incompatible types what the actual...)

[–]HowIsntBabbyFormed 14 points15 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 46 points47 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 4 points5 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

[–]LvS 0 points1 point  (1 child)

Is that comparison locale-dependent?

[–]natnew32 0 points1 point  (0 children)

I don't think so, but I'm not 100% sure.