Why does comparison like : (2,) < {2}
give False
, while [2] < {2}
give True
?
Asked
Active
Viewed 44 times
0

herbert
- 65
- 2
- 6
-
2This is a Python 2 wart, comparison is done by type's name. [Won't work in Python 3 though](https://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons). – Ashwini Chaudhary Dec 09 '16 at 08:48
-
1Also see http://stackoverflow.com/questions/2384078/why-is-0-true-in-python – PM 2Ring Dec 09 '16 at 08:52