From: Jeffrey Miller <jsmiller@google.com>
At this URL and this section of the reference:
http://docs.python.org/ref/customization.html
3.4.1 Basic Customization
The existing text reads, in part:
"""
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.
"""
but is incorrect. Although __le__ and __ge__ are symmetric, as are __lt__ and __gt__, they are not boolean inverse operations if the arguments are swapped.
Instead the text should pair __lt__ with __ge__, __le__ with __gt__ .
Correcting the given text, it should read:
"""
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 __ge__() are each other's reflection, __le__() and __gt__() are each other's reflection, and __eq__() and __ne__() are their own reflection.
"""
|