Skip to content

Commit 688d2d5

Browse files
committed
Fixed Ruff Lints
1 parent 5934bb4 commit 688d2d5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/sage/categories/commutative_rings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ def sqrt(self, extend=True, all=False, name=None):
729729
if all:
730730
if P not in IntegralDomains():
731731
raise NotImplementedError('sqrt() with all=True is only implemented for integral domains, not for %s' % P)
732-
if P.characteristic()==2 or sq_rt==0:
732+
if P.characteristic() == 2 or sq_rt == 0:
733733
# 0 has only one square root, and in characteristic 2 everything also has only 1 root
734734
return [sq_rt]
735735
return [sq_rt, -sq_rt]
@@ -748,7 +748,7 @@ def sqrt(self, extend=True, all=False, name=None):
748748
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
749749
PY = PolynomialRing(P, 'y')
750750
y = PY.gen()
751-
sq_rt = PY.quotient(y**2-self, names = name)(y)
751+
sq_rt = PY.quotient(y**2-self, names=name)(y)
752752
if all:
753753
if P.characteristic() == 2:
754754
return [sq_rt]

src/sage/categories/finite_fields.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def _cipolla(self):
386386
b = pow(X, (q+1)//2, f)
387387
return b
388388

389-
def sqrt(self, all:bool =False, algorithm: str ='tonelli'):
389+
def sqrt(self, all: bool = False, algorithm: str = 'tonelli'):
390390
r"""
391391
Returns the square root of the element if it exists
392392
@@ -440,7 +440,7 @@ def sqrt(self, all:bool =False, algorithm: str ='tonelli'):
440440
The algorithms used come from chapter 6 of [BS1996]_.
441441
Let `q = p^n` be the order of the finite field, let `a` be the finite field element
442442
that we wish to find the square root of.
443-
443+
444444
- If `p = 2` then `a` is always a square, and the square root of `\sqrt{a} = a^{(q / 2)}`.
445445
- If `q \equiv 3 \pmod{4}` then if `a` is a square `\sqrt{a} = {a^((q+1) / 4)}`
446446
- For all other cases we use the algorithm given by the ``algorithm`` parameter.

0 commit comments

Comments
 (0)