Skip to content

Commit

Permalink
Trac #22369: FGP_Element: cmp -> richcmp
Browse files Browse the repository at this point in the history
URL: https://trac.sagemath.org/22369
Reported by: jdemeyer
Ticket author(s): Marc Mezzarobba
Reviewer(s): Jeroen Demeyer
  • Loading branch information
Release Manager authored and vbraun committed Feb 16, 2017
2 parents 94d0cbb + 28ca821 commit f6f1288
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sage/modules/fg_pid/fgp_element.py
Expand Up @@ -16,6 +16,7 @@
#*****************************************************************************

from sage.structure.element import ModuleElement
from sage.structure.sage_object import richcmp

# This adds extra maybe-not-necessary checks in the code, but could
# slow things down. It can impact what happens in more than just this
Expand Down Expand Up @@ -400,7 +401,7 @@ def _vector_(self, base_ring=None):
else:
return v.change_ring(base_ring)

def __cmp__(self, right):
def _richcmp_(self, right, op):
"""
Compare self and right.
Expand All @@ -420,7 +421,7 @@ def __cmp__(self, right):
sage: x + x == 2*x
True
"""
return cmp(self.vector(), right.vector())
return richcmp(self.vector(), right.vector(), op)

def additive_order(self):
"""
Expand Down

0 comments on commit f6f1288

Please sign in to comment.