0

Why does comparison like : (2,) < {2} give False, while [2] < {2} give True?

herbert
  • 65
  • 2
  • 6
  • 2
    This 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
  • 1
    Also see http://stackoverflow.com/questions/2384078/why-is-0-true-in-python – PM 2Ring Dec 09 '16 at 08:52

0 Answers0