2 ms·
Quite the contrary, it's very beautiful and useful: >>> (1, 2) == (1, 2) True >>> (2, 1) == (1, 2) False If you need identity for perf: >
by BiteCode_dev 7y ago
Quite the contrary, it's very beautiful and useful:
>>> (1, 2) == (1, 2)
True
>>> (2, 1) == (1, 2)
False
If you need identity for perf:
>>> (1, 2) is (1, 2)
False
If you just need the type check:
>>> isinstance((1, 2), type((1, 2)))
True
It's very explicit, practical, and you can set the scale of practicality vs performances where you want. Plus: no implicit weird type conversion, only one equality comparison operator, and no hidden rules.
I think it's sane.