Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
py3 deprecation of call to cmp on RIF elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Frédéric Chapoton committed Apr 30, 2017
1 parent 20cd81e commit ea97bfc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/sage/rings/real_mpfi.pyx
Expand Up @@ -3817,6 +3817,22 @@ cdef class RealIntervalFieldElement(RingElement):
else:
return 0

cpdef int _cmp_(self, other) except -2:
"""
Deprecated method (:trac:`22907`)
EXAMPLES::
sage: a = RIF(1)
sage: a.__cmp__(a)
doctest:...: DeprecationWarning: for RIF elements, do not use cmp
See http://trac.sagemath.org/22907 for details.
0
"""
from sage.misc.superseded import deprecation
deprecation(22907, 'for RIF elements, do not use cmp')
return self.lexico_cmp(other)

def __contains__(self, other):
"""
Test whether one interval (or real number) is totally contained in
Expand Down

0 comments on commit ea97bfc

Please sign in to comment.