[docs] Comparison error?
Reich, Edwin
edreich at lab126.com
Thu Sep 15 16:30:34 CEST 2011
While reading through the "New-style and classic classes" section of the documentation http://docs.python.org/reference/datamodel.html#newstyle I found what I believe to be an error.
The statement regarding rich comparison methods reads:
There are no 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.
The error is that __lt__() and __ge__() should be the reflection of each other and __le__() and __gt__() should be the reflection of each other. Hopefully, this is an error only in the documentation and not the language. I haven't tested the language to verify that it doesn't work as documented.
Thanks,
Edwin
More information about the docs
mailing list