Skip to content

Commit 6b16ebb

Browse files
author
Release Manager
committed
gh-36893: get rid of one ParentWithGens mirco-ticket to get rid of one `ParentWithGens` ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. URL: #36893 Reported by: Frédéric Chapoton Reviewer(s): Travis Scrimshaw
2 parents b3d1c67 + 086a13f commit 6b16ebb

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
@@ -38,7 +38,6 @@ from sage.structure.element import coerce_binop
3838
from sage.rings.infinity import infinity
3939
from sage.structure.element cimport Element, RingElement, AlgebraElement
4040
from sage.structure.parent cimport Parent
41-
from sage.structure.parent_gens cimport ParentWithGens
4241
from sage.categories.homset import Hom
4342
from sage.rings.ring import _Fields
4443
from sage.rings.integer cimport Integer
@@ -2339,9 +2338,9 @@ cdef class OrePolynomial_generic_dense(OrePolynomial):
23392338
cdef long c_hash
23402339
cdef long var_name_hash = 0
23412340
cdef int i
2342-
for i from 0 <= i < len(self._coeffs):
2341+
for i in range(len(self._coeffs)):
23432342
if i == 1:
2344-
var_name_hash = hash((<ParentWithGens>self._parent)._names[0])
2343+
var_name_hash = hash(self._parent._names[0])
23452344
c_hash = hash(self._coeffs[i])
23462345
if c_hash != 0:
23472346
if i == 0:
@@ -2577,9 +2576,9 @@ cdef class OrePolynomial_generic_dense(OrePolynomial):
25772576
cdef list y = (<OrePolynomial_generic_dense>right)._coeffs
25782577
cdef Py_ssize_t dx = len(x), dy = len(y)
25792578
if dx > dy:
2580-
r = self._new_c([x[i] + y[i] for i from 0 <= i < dy] + x[dy:], self._parent, 0)
2579+
r = self._new_c([x[i] + y[i] for i in range(dy)] + x[dy:], self._parent, 0)
25812580
elif dx < dy:
2582-
r = self._new_c([x[i] + y[i] for i from 0 <= i < dx] + y[dx:], self._parent, 0)
2581+
r = self._new_c([x[i] + y[i] for i in range(dx)] + y[dx:], self._parent, 0)
25832582
else:
25842583
r = self._new_c([x[i] + y[i] for i in range(dx)], self._parent, 1)
25852584
return r

0 commit comments

Comments
 (0)