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.

Author David Seddon
Recipients David Seddon
Date 2015-11-25.13:12:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The documentation for functools.total_ordering states that rich comparison can be enabled on a class by specifying an __eq__ method, and one of __lt__(), __le__(), __gt__(), or __ge__().  If these instructions are followed, this results in an incorrect evaluation of the not equal operator:

Here's an example:

    from functools import total_ordering

    class Value(object):

        def __init__(self, value):
            self.value = value
        def __eq__(self, other):
            return self.value == other.value
        def __lt__(self, other):
            return self.value < other.value

    >>> a = Value(3)
    >>> b = Value(3)
    >>> a == b
    >>> a != b

I've tested this on 2.7.10.
Either the documentation or the behaviour should be corrected.
Date User Action Args
2015-11-25 13:12:49David Seddonsetrecipients: + David Seddon
2015-11-25 13:12:49David Seddonsetmessageid: <>
2015-11-25 13:12:49David Seddonlinkissue25732 messages
2015-11-25 13:12:48David Seddoncreate