Issue 1682729: Documentation error (section 3.4.1) (original) (raw)

In the documentation section 3.4.1 Basic customization (url: http://docs.python.org/ref/customization.html) it states:

There are no reflected (swapped-argument) versions of these methods (to be used when the left argument does not support the operation but the right argument does); rather, lt() and gt() are each other's reflection, le() and ge() are each other's reflection, and eq() and ne() are their own reflection.

Surely that should be lt() and ge() are each other's reflection, and le() and gt(). I assume this is just a typo, but I haven't checked that Python itself gets it right.

No, the documentation is correct (as well as Python's behaviour). For example, you have a left_five and right_five, which are int like objects with value 5, and left_five is missing a lt method. If you do a left_five < right_five comparison, you want right_five's gt method called, because right_five's ge method would return True, since their values are equal.