[issue10042] total_ordering stack overflow

Alexander Boyd report at bugs.python.org
Tue Apr 19 01:17:18 CEST 2011


Alexander Boyd <alex at opengroove.org> added the comment:

But it seems pointless to force someone to implement all of the rich comparison methods when they may want to do something as simple as this:

class Foo:
    ...
    def __lt__(self, other):
        if not isinstance(other, Foo):
            return NotImplemented
        return self.some_value < other.some_value

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10042>
_______________________________________


More information about the Python-bugs-list mailing list