0

My problem is that I really don't understand why is that, and if you can explain me what's "happening behind" the evaluation I would really appreciate!

Note: also (True<={}), (False<={}), (ANY_NUMBER<={}) returns True.

SparkAndShine
  • 17,001
  • 22
  • 90
  • 134
Tommy
  • 208
  • 2
  • 8
  • 1
    Python 2 tries to give any sequence, regardless of how many types are involved, a stable order when sorted. It does so by sorting types by their type name, but numbers always come before anything else. This choice is arbitrary, an implementation detail. Python 3 does away with heterogenous sequence ordering altogether. – Martijn Pieters Jun 07 '16 at 20:34
  • Since `bool` is a subclass of `int`, they are numbers in this regard. – Martijn Pieters Jun 07 '16 at 20:34

0 Answers0