@@ -37,7 +37,6 @@ from sage.structure.element import coerce_binop
37
37
from sage.rings.infinity import infinity
38
38
from sage.structure.element cimport Element, RingElement, AlgebraElement
39
39
from sage.structure.parent cimport Parent
40
- from sage.structure.parent_gens cimport ParentWithGens
41
40
from sage.categories.homset import Hom
42
41
from sage.rings.ring import _Fields
43
42
from sage.rings.integer cimport Integer
@@ -2338,9 +2337,9 @@ cdef class OrePolynomial_generic_dense(OrePolynomial):
2338
2337
cdef long c_hash
2339
2338
cdef long var_name_hash = 0
2340
2339
cdef int i
2341
- for i from 0 <= i < len (self ._coeffs):
2340
+ for i in range ( len (self ._coeffs) ):
2342
2341
if i == 1 :
2343
- var_name_hash = hash (( < ParentWithGens > self ._parent) ._names[0 ])
2342
+ var_name_hash = hash (self ._parent._names[0 ])
2344
2343
c_hash = hash (self ._coeffs[i])
2345
2344
if c_hash != 0 :
2346
2345
if i == 0 :
@@ -2576,9 +2575,9 @@ cdef class OrePolynomial_generic_dense(OrePolynomial):
2576
2575
cdef list y = (< OrePolynomial_generic_dense> right)._coeffs
2577
2576
cdef Py_ssize_t dx = len (x), dy = len (y)
2578
2577
if dx > dy:
2579
- r = self ._new_c([x[i] + y[i] for i from 0 <= i < dy ] + x[dy:], self ._parent, 0 )
2578
+ r = self ._new_c([x[i] + y[i] for i in range (dy) ] + x[dy:], self ._parent, 0 )
2580
2579
elif dx < dy:
2581
- r = self ._new_c([x[i] + y[i] for i from 0 <= i < dx ] + y[dx:], self ._parent, 0 )
2580
+ r = self ._new_c([x[i] + y[i] for i in range (dx) ] + y[dx:], self ._parent, 0 )
2582
2581
else :
2583
2582
r = self ._new_c([x[i] + y[i] for i in range (dx)], self ._parent, 1 )
2584
2583
return r
0 commit comments