Skip to content

Commit

Permalink
Trac #23485: Ring morphisms should not override __richcmp__
Browse files Browse the repository at this point in the history
But only override `_richcmp_` instead.

Overwriting `__richcmp__` used to be necessary to override `__hash__`.
This is not the case anymore it seems.

URL: https://trac.sagemath.org/23485
Reported by: saraedum
Ticket author(s): Julian Rüth
Reviewer(s): Aly Deines, Jeroen Demeyer, David Roe
  • Loading branch information
Release Manager authored and vbraun committed Aug 5, 2017
2 parents fb6e3fa + ffc7371 commit bb4c2a0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sage/rings/morphism.pyx
Expand Up @@ -509,7 +509,7 @@ cdef class RingMap_lift(RingMap):
_slots['S'] = self.S
return Morphism._extra_slots(self, _slots)

def __richcmp__(self, other, int op):
def _richcmp_(self, other, int op):
"""
Compare a ring lifting maps ``self`` to ``other``.
Expand Down Expand Up @@ -906,7 +906,7 @@ cdef class RingHomomorphism_coercion(RingHomomorphism):
"""
return "Ring Coercion"

def __richcmp__(self, other, int op):
def _richcmp_(self, other, int op):
"""
Compare a ring coercion morphism ``self`` to ``other``.
Expand Down Expand Up @@ -1599,7 +1599,7 @@ cdef class RingHomomorphism_cover(RingHomomorphism):
"""
return self.codomain().defining_ideal()

def __richcmp__(self, other, int op):
def _richcmp_(self, other, int op):
"""
Compare ``self`` to ``other``.
Expand Down Expand Up @@ -1796,7 +1796,7 @@ cdef class RingHomomorphism_from_quotient(RingHomomorphism):
"""
return self.phi

def __richcmp__(self, other, op):
def _richcmp_(self, other, op):
"""
Compare ``self`` to ``other``.
Expand Down

0 comments on commit bb4c2a0

Please sign in to comment.