Skip to content

Commit 086a13f

Browse files
committed
get rid of one ParentWithGens
1 parent e2e0f8d commit 086a13f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/sage/rings/polynomial/ore_polynomial_element.pyx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ from sage.structure.element import coerce_binop
3737
from sage.rings.infinity import infinity
3838
from sage.structure.element cimport Element, RingElement, AlgebraElement
3939
from sage.structure.parent cimport Parent
40-
from sage.structure.parent_gens cimport ParentWithGens
4140
from sage.categories.homset import Hom
4241
from sage.rings.ring import _Fields
4342
from sage.rings.integer cimport Integer
@@ -2338,9 +2337,9 @@ cdef class OrePolynomial_generic_dense(OrePolynomial):
23382337
cdef long c_hash
23392338
cdef long var_name_hash = 0
23402339
cdef int i
2341-
for i from 0 <= i < len(self._coeffs):
2340+
for i in range(len(self._coeffs)):
23422341
if i == 1:
2343-
var_name_hash = hash((<ParentWithGens>self._parent)._names[0])
2342+
var_name_hash = hash(self._parent._names[0])
23442343
c_hash = hash(self._coeffs[i])
23452344
if c_hash != 0:
23462345
if i == 0:
@@ -2576,9 +2575,9 @@ cdef class OrePolynomial_generic_dense(OrePolynomial):
25762575
cdef list y = (<OrePolynomial_generic_dense>right)._coeffs
25772576
cdef Py_ssize_t dx = len(x), dy = len(y)
25782577
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)
25802579
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)
25822581
else:
25832582
r = self._new_c([x[i] + y[i] for i in range(dx)], self._parent, 1)
25842583
return r

0 commit comments

Comments
 (0)