Opened 4 years ago
Closed 4 years ago
#22530 closed enhancement (duplicate)
Revert six.iteritems in laurent_polynomial.pyx
Reported by: | jdemeyer | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | cython | Keywords: | |
Cc: | dkrenn | Merged in: | |
Authors: | Reviewers: | Jeroen Demeyer | |
Report Upstream: | N/A | Work issues: | |
Branch: | u/jdemeyer/revert_six_iteritems_in_laurent_polynomial_pyx (Commits, GitHub, GitLab) | Commit: | 1fc5c7b3c3e9d2f5380904f5191d73672888a94a |
Dependencies: | Stopgaps: |
Description (last modified by )
Revert
-
src/sage/rings/polynomial/laurent_polynomial.pyx
commit 92699fd23f29568077c577b65a1c561b7415269a Author: Daniel Krenn <git@danielkrenn.at> Date: Thu Nov 10 14:40:28 2016 +0100 Python3-ify (iteritems) diff --git a/src/sage/rings/polynomial/laurent_polynomial.pyx b/src/sage/rings/polynomial/laurent_polynomial.pyx index fa61705..e6db620 100644
a b Elements of Laurent polynomial rings 10 10 # http://www.gnu.org/licenses/ 11 11 #***************************************************************************** 12 12 from __future__ import print_function 13 from six import iterkeys, iteritems 13 14 14 15 from sage.rings.integer cimport Integer 15 16 from sage.structure.element import is_Element, coerce_binop … … cdef class LaurentPolynomial_mpair(LaurentPolynomial_generic): 2482 2483 except ValueError: 2483 2484 # call _derivative() recursively on coefficients 2484 2485 return P({m: c._derivative(var) 2485 for (m, c) in self.dict().iteritems()})2486 for (m, c) in iteritems(self.dict())}) 2486 2487 2487 2488 # compute formal derivative with respect to generator 2488 2489 d = {} 2489 for m, c in self.dict().iteritems():2490 for m, c in iteritems(self.dict()): 2490 2491 if m[index] != 0: 2491 2492 new_m = [u for u in m] 2492 2493 new_m[index] += -1
Cython understands dict.iteritems()
and actually optimizes it (unlike six.iteritems
)
Change History (5)
comment:1 Changed 4 years ago by
- Description modified (diff)
comment:2 Changed 4 years ago by
- Branch set to u/jdemeyer/revert_six_iteritems_in_laurent_polynomial_pyx
comment:3 Changed 4 years ago by
- Commit set to 1fc5c7b3c3e9d2f5380904f5191d73672888a94a
- Status changed from new to needs_review
comment:4 Changed 4 years ago by
see #22515
comment:5 Changed 4 years ago by
- Milestone changed from sage-7.6 to sage-duplicate/invalid/wontfix
- Resolution set to duplicate
- Reviewers set to Jeroen Demeyer
- Status changed from needs_review to closed
Note: See
TracTickets for help on using
tickets.
New commits:
Revert "Python3-ify (iteritems)"