Skip to content

Commit e3b12dd

Browse files
committed
linter
1 parent 38e93a5 commit e3b12dd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/sage/rings/polynomial/polynomial_element.pyx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,7 +2564,7 @@ cdef class Polynomial(CommutativePolynomial):
25642564
if ring is not None:
25652565
# If the new ring is not a finite field, attempt to coerce the polynomial
25662566
# and call the function to use naive factoring
2567-
if not ring in FiniteFields():
2567+
if ring not in FiniteFields():
25682568
try:
25692569
f = self.change_ring(ring)
25702570
except ValueError:
@@ -2605,18 +2605,17 @@ cdef class Polynomial(CommutativePolynomial):
26052605
# should be fine. As a result, we simply coerce straight to the user supplied
26062606
# ring and find a root here.
26072607
# TODO: Additionally, if the above was solved, it would be faster to extend the base
2608-
# ring with the irreducible factor however, if the base ring is an extension
2608+
# ring with the irreducible factor however, if the base ring is an extension
26092609
# then the type of self.base_ring().extension(f) is a Univariate Quotient Polynomial Ring
26102610
# and not a finite field. So we do the slower option here to ensure the type is
26112611
# maintained.
26122612
if not d.is_one():
26132613
f = f.change_ring(ring)
2614-
2614+
26152615
# Now we find the root of this irreducible polynomial over this extension
26162616
root = f.any_root()
26172617
return ring(root)
26182618

2619-
26202619
# If the loop ends and we returned nothing, then no root exists
26212620
raise ValueError(f"no root of polynomial {self} can be computed over the ring {ring}")
26222621

0 commit comments

Comments
 (0)