Skip to content

Commit 2cd9c80

Browse files
author
Release Manager
committed
gh-39347: activate check for ruff PLW0127 activate one more check in the `ruff-minimal` linter: PLW0127 Self-assignment of variable ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: #39347 Reported by: Frédéric Chapoton Reviewer(s): Kwankyu Lee
2 parents ef384b4 + 68c0e59 commit 2cd9c80

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/sage/combinat/designs/orthogonal_arrays_build_recursive.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -837,14 +837,14 @@ def thwart_lemma_4_1(k, n, m, explain_construction=False):
837837
# - (1+t,t,1+t), (1,1,1), (1+t,t,t), (1,1,2), (0,0,1), (1,0,1), (0,1,1+t),
838838
# (0,1,1), (1,0,-t)
839839
points = [(1+t,t,1+t), (1,1,1), (1+t,t,t), (1,1,2), (0,0,1), (1,0,1), (0,1,1+t), (0,1,1), (1,0,-t)]
840-
points = [[K(_) for _ in t] for t in points] # triples of K^3
840+
points = [[K(c) for c in t] for t in points] # triples of K^3
841841
AG_2_3 = []
842842
for x,y,z in points:
843843
if z != 0:
844-
x,y,z = x/z,y/z,z/z
844+
x, y, z = x / z, y / z, K.one()
845845
AG_2_3.append(relabel[x]+n*relabel[y])
846846
elif y != 0:
847-
x,y,z = x/y,y/y,z
847+
x, y = x / y, K.one()
848848
AG_2_3.append(q**2+relabel[x])
849849
else:
850850
AG_2_3.append(q**2+q)

src/sage/combinat/skew_tableau.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1042,10 +1042,10 @@ def backward_slide(self, corner=None):
10421042
# -1, which doesn't trigger the conditional
10431043
if P_left > P_up:
10441044
new_st[i][j] = P_left
1045-
i, j = (i, j - 1)
1045+
j = j - 1
10461046
else: # if they are equal, we slide up
10471047
new_st[i][j] = P_up
1048-
i, j = (i - 1, j)
1048+
i = i - 1
10491049
# We don't need to reset the intermediate cells inside the loop
10501050
# because the conditional above will continue to overwrite it until
10511051
# the while loop terminates. We do need to reset it at the end.

src/sage/interacts/library.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ def bisection_method(title, f, interval, d, maxn):
925925
maxn: IntSlider(value=10, description='max iterations', max=15)
926926
"""
927927
def _bisection_method(f, a, b, maxn, eps):
928-
intervals = [(a,b)]
928+
intervals = [(a, b)]
929929
round = 1
930930
two = float(2)
931931
while True:
@@ -938,12 +938,12 @@ def _bisection_method(f, a, b, maxn, eps):
938938
if abs(fc) < eps:
939939
return c, intervals
940940
if fa*fc < 0:
941-
a, b = a, c
941+
b = c
942942
elif fc*fb < 0:
943-
a, b = c, b
943+
a = c
944944
else:
945945
raise ValueError("f must have a sign change in the interval (%s,%s)" % (a,b))
946-
intervals.append((a,b))
946+
intervals.append((a, b))
947947
round += 1
948948
return c, intervals
949949

src/tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ passenv = RUFF_OUTPUT_FORMAT
311311
# 1 F402 [ ] Import `factor` from line 259 shadowed by loop variable
312312
# 1 PLC0208 [*] Use a sequence type instead of a `set` when iterating over values
313313
#
314-
commands = ruff check --ignore E402,E721,E731,E741,E742,E743,F401,F402,F403,F405,F821,F841,I001,PLC0206,PLC0208,PLC2401,PLC3002,PLE0302,PLR0124,PLR0402,PLR0911,PLR0912,PLR0913,PLR0915,PLR1704,PLR1711,PLR1714,PLR1716,PLR1736,PLR2004,PLR5501,PLW0120,PLW0127,PLW0211,PLW0602,PLW0603,PLW0642,PLW1508,PLW1510,PLW2901,PLW3301 {posargs:{toxinidir}/sage/}
314+
commands = ruff check --ignore E402,E721,E731,E741,E742,E743,F401,F402,F403,F405,F821,F841,I001,PLC0206,PLC0208,PLC2401,PLC3002,PLE0302,PLR0124,PLR0402,PLR0911,PLR0912,PLR0913,PLR0915,PLR1704,PLR1711,PLR1714,PLR1716,PLR1736,PLR2004,PLR5501,PLW0120,PLW0211,PLW0602,PLW0603,PLW0642,PLW1508,PLW1510,PLW2901,PLW3301 {posargs:{toxinidir}/sage/}
315315

316316
[flake8]
317317
rst-roles =

0 commit comments

Comments
 (0)