Gabriel Genellina said:
Reference Manual, 5.9 Comparisons
"The objects need not have the same type. If both are numbers, they are
converted to a common type. Otherwise, objects of different types always
compare unequal, and are ordered consistently but arbitrarily."
(Apart from the latter not menctioning string types too, looks good to
me).
Right. However, it might be worth underscoring that this applies to
_built-in_ types, and user-defined types are free to implement different
comparison semantics, although that should be done with care and good
taste; for example, one might have a collection type defining __eq__ to
mean "the same set of items as the other [iterable] operand in any
order", though that might cause weird behavior such as a==b but b!=a
(unfortunately there's no __req__, and __coerce__ is not involved in
comparisons either).