Skip to content

Commit

Permalink
Improve handling of 'op' in __richcmp__ in coxter.pyx
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpalmieri committed Aug 5, 2023
1 parent 21ce8b6 commit c11b4f6
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/sage/libs/coxeter3/coxeter.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ cdef class String:
True
"""
if type(other) is not type(self):
return False
if op in (Py_LT, Py_LE, Py_GT, Py_GE):
return NotImplemented
return op == Py_NE

s = repr(self)
o = repr(other)
Expand Down Expand Up @@ -200,7 +202,9 @@ cdef class Type:
True
"""
if type(other) is not type(self):
return False
if op in (Py_LT, Py_LE, Py_GT, Py_GE):
return NotImplemented
return op == Py_NE

s = repr(self)
o = repr(other)
Expand Down Expand Up @@ -364,7 +368,9 @@ cdef class CoxGroup(SageObject):
True
"""
if type(other) is not type(self):
return False
if op in (Py_LT, Py_LE, Py_GT, Py_GE):
return NotImplemented
return op == Py_NE

s_t = self.type()
o_t = other.type()
Expand Down Expand Up @@ -840,7 +846,9 @@ cdef class CoxGroupElement:
True
"""
if type(other) is not type(self):
return False
if op in (Py_LT, Py_LE, Py_GT, Py_GE):
return NotImplemented
return op == Py_NE

s_p = self.parent_group()
o_p = other.parent_group()
Expand Down

0 comments on commit c11b4f6

Please sign in to comment.