In Python2, the docs say:
CPython implementation detail: Objects of different types except
numbers are ordered by their type names; objects of the same types
that don’t support proper comparison are ordered by their address.
In Python3, this wart is fixed:
The ordering comparison operators (<, <=, >=, >) raise a TypeError
exception when the operands don’t have a meaningful natural ordering.
Thus, expressions like 1 < '', 0 > None or len <= len are no longer
valid, and e.g. None < None raises TypeError instead of returning
False. A corollary is that sorting a heterogeneous list no longer
makes sense – all the elements must be comparable to each other. Note
that this does not apply to the == and != operators: objects of
different incomparable types always compare unequal to each other.