Skip to content

Commit

Permalink
Trac #24409: py3: remove deprecated cmpfn ; wrap key(..) in multi-pol…
Browse files Browse the repository at this point in the history
…ynomials

as followup of #21766 and part of #16536 and #15981

URL: https://trac.sagemath.org/24409
Reported by: chapoton
Ticket author(s): Frédéric Chapoton
Reviewer(s): André Apitzsch
  • Loading branch information
Release Manager authored and vbraun committed Dec 23, 2017
2 parents 4741eff + a7dbdff commit 3981c22
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/sage/rings/polynomial/polydict.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ cdef class PolyDict:

def list(PolyDict self):
"""
Return a list that defines self. It is safe to change this.
Return a list that defines ``self``. It is safe to change this.
EXAMPLES::
Expand Down Expand Up @@ -408,16 +408,16 @@ cdef class PolyDict:
return PolyDict(H, zero=self.__zero, force_etuples=False)

def latex(PolyDict self, vars, atomic_exponents=True,
atomic_coefficients=True, cmpfn=None, sortkey=None):
atomic_coefficients=True, sortkey=None):
r"""
Return a nice polynomial latex representation of this PolyDict, where
the vars are substituted in.
INPUT:
- ``vars`` -- list
- ``atomic_exponents`` -- bool (default: True)
- ``atomic_coefficients`` -- bool (default: True)
- ``atomic_exponents`` -- bool (default: ``True``)
- ``atomic_coefficients`` -- bool (default: ``True``)
EXAMPLES::
Expand Down Expand Up @@ -445,12 +445,9 @@ cdef class PolyDict:
"""
n = len(vars)
poly = ""
E = self.__repn.keys()
E = list(self.__repn)
if sortkey:
E.sort(key=sortkey, reverse=True)
elif cmpfn:
deprecation(21766, 'the cmpfn keyword is deprecated, use sortkey')
E.sort(cmp=cmpfn, reverse=True)
else:
E.sort(reverse=True)
try:
Expand Down Expand Up @@ -498,7 +495,7 @@ cdef class PolyDict:
return poly

def poly_repr(PolyDict self, vars, atomic_exponents=True,
atomic_coefficients=True, cmpfn=None, sortkey=None):
atomic_coefficients=True, sortkey=None):
"""
Return a nice polynomial string representation of this PolyDict, where
the vars are substituted in.
Expand Down Expand Up @@ -538,12 +535,9 @@ cdef class PolyDict:
"""
n = len(vars)
poly = ""
E = self.__repn.keys()
E = list(self.__repn)
if sortkey:
E.sort(key=sortkey, reverse=True)
elif cmpfn:
deprecation(21766, 'the cmpfn keyword is deprecated, use sortkey')
E.sort(cmp=cmpfn, reverse=True)
else:
E.sort(reverse=True)
try:
Expand Down

0 comments on commit 3981c22

Please sign in to comment.