In Basic customisation, the python docs state about comparison methods:
[no swapped-argument versions of these methods]; 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.
I'd be less surprised by __lt__()
and __ge__()
being each other’s reflection(, as well as __le__()
and __gt__()
).
While the docs also state:
… no other implied relationships among the comparison operators, for example, the truth of
(x<y or x==y)
does not implyx<=y
,
what, if anything, is the or would be a rationale for the reflection relations chosen?
@functools.total_ordering
, python bug with le, ge?.