Skip to content

Commit

Permalink
FGP_Element: cmp -> richcmp
Browse files Browse the repository at this point in the history
  • Loading branch information
mezzarobba authored and jdemeyer committed Feb 12, 2017
1 parent bf876cb commit 28ca821
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sage/modules/fg_pid/fgp_element.py
Original file line number Diff line number Diff line change
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 28ca821

Please sign in to comment.