@@ -1003,16 +1003,13 @@ pretty).
10031003
10041004The operators ``< ``, ``> ``, ``== ``, ``>= ``, ``<= ``, and ``!= `` compare the
10051005values of two objects. The objects need not have the same type. If both are
1006- numbers, they are converted to a common type. Otherwise, objects of different
1007- types *always * compare unequal, and are ordered consistently but arbitrarily.
1008- You can control comparison behavior of objects of non-builtin types by defining
1009- a :meth: `__cmp__ ` method or rich comparison methods like :meth: `__gt__ `,
1010- described in section :ref: `specialnames `.
1011-
1012- (This unusual definition of comparison was used to simplify the definition of
1013- operations like sorting and the :keyword: `in ` and :keyword: `not in ` operators.
1014- In the future, the comparison rules for objects of different types are likely to
1015- change.)
1006+ numbers, they are converted to a common type. Otherwise, the ``== `` and ``!= ``
1007+ operators *always * consider objects of different types to be unequal, while the
1008+ ``< ``, ``> ``, ``>= `` and ``<= `` operators raise a :exc: `TypeError ` when
1009+ comparing objects of different types that do not implement these operators for
1010+ the given pair of types. You can control comparison behavior of objects of
1011+ non-builtin types by defining rich comparison methods like :meth: `__gt__ `,
1012+ described in section :ref: `customization `.
10161013
10171014Comparison of objects of the same type depends on the type:
10181015
0 commit comments