This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Documentation error (section 3.4.1)
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: emlyncorrin, zseil
Priority: normal Keywords:

Created on 2007-03-17 14:03 by emlyncorrin, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg31558 - (view) Author: emlyn (emlyncorrin) Date: 2007-03-17 14:03
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.
msg31559 - (view) Author: Ziga Seilnacht (zseil) * (Python committer) Date: 2007-03-17 15:40
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.
History
Date User Action Args
2022-04-11 14:56:23adminsetgithub: 44734
2007-03-17 14:03:34emlyncorrincreate