Skip to content

Commit 8a1fdf6

Browse files
author
Release Manager
committed
gh-40085: fix the pycodestyle-minimal linter as this is not longer checked, this breaks at every release, sigh ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: #40085 Reported by: Frédéric Chapoton Reviewer(s):
2 parents 6ba54bd + 9be92f6 commit 8a1fdf6

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed

src/sage/arith/misc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3760,11 +3760,13 @@ def CRT_vectors(X, moduli):
37603760
modulus = LCM_list(moduli)
37613761
candidate = [sum(a[i] * X[i][j] for i in range(n)) % modulus
37623762
for j in range(len(X[0]))]
3763-
if not res[1] and any((X[i][j] - candidate[j]) % moduli[i] != 0 for i in range(n)
3763+
if not res[1] and any((X[i][j] - candidate[j]) % moduli[i] != 0
3764+
for i in range(n)
37643765
for j in range(len(X[i]))):
37653766
raise ValueError("solution does not exist")
37663767
return candidate
37673768

3769+
37683770
def binomial(x, m, **kwds):
37693771
r"""
37703772
Return the binomial coefficient.

src/sage/calculus/calculus.py

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,16 +1208,16 @@ def limit(ex, *args, dir=None, taylor=False, algorithm='maxima', **kwargs):
12081208
sage: f = (1 + 1/x)^x
12091209
sage: limit(f, x=oo)
12101210
e
1211-
sage: limit(f, x, oo)
1211+
sage: limit(f, x, oo)
12121212
e
12131213
sage: f.limit(x=5)
12141214
7776/3125
12151215
sage: f.limit(x, 5)
12161216
7776/3125
12171217
1218-
The positional ``limit(expr, v, a)`` syntax is particularly useful
1219-
when the limit variable ``v`` is an indexed variable or another
1220-
expression that cannot be used as a keyword argument
1218+
The positional ``limit(expr, v, a)`` syntax is particularly useful
1219+
when the limit variable ``v`` is an indexed variable or another
1220+
expression that cannot be used as a keyword argument
12211221
(fixes :issue:`38761`)::
12221222
12231223
sage: y = var('y', n=3)
@@ -1280,7 +1280,7 @@ def limit(ex, *args, dir=None, taylor=False, algorithm='maxima', **kwargs):
12801280
12811281
sage: maxima_calculus.eval("domain:real")
12821282
...
1283-
sage: f = (1 + 1/x)^x
1283+
sage: f = (1 + 1/x)^x
12841284
sage: f.limit(x=1.2).n()
12851285
2.06961575467...
12861286
sage: maxima_calculus.eval("domain:complex");
@@ -1550,19 +1550,19 @@ def limit(ex, *args, dir=None, taylor=False, algorithm='maxima', **kwargs):
15501550
v = args[0]
15511551
a = args[1]
15521552
elif len(args) == 1:
1553-
if kwargs:
1554-
raise ValueError("cannot mix positional specification of limit variable and point with keyword variable arguments")
1553+
if kwargs:
1554+
raise ValueError("cannot mix positional specification of limit variable and point with keyword variable arguments")
15551555
else:
1556-
raise ValueError("three positional arguments (expr, v, a) or one positional and one keyword argument (expr, v=a) required")
1557-
elif len(args) == 0: # Potential syntax: limit(ex, v=a, ...) or limit(ex)
1558-
if len(kwargs) == 1:
1556+
raise ValueError("three positional arguments (expr, v, a) or one positional and one keyword argument (expr, v=a) required")
1557+
elif len(args) == 0: # Potential syntax: limit(ex, v=a, ...) or limit(ex)
1558+
if len(kwargs) == 1:
15591559
k, = kwargs.keys()
15601560
v = var(k)
15611561
a = kwargs[k]
1562-
elif len(kwargs) == 0: # For No variable specified at all
1563-
raise ValueError("invalid limit specification")
1564-
else: # For Multiple keyword arguments like x=1, y=2
1565-
raise ValueError("multiple keyword arguments specified")
1562+
elif len(kwargs) == 0: # For No variable specified at all
1563+
raise ValueError("invalid limit specification")
1564+
else: # For Multiple keyword arguments like x=1, y=2
1565+
raise ValueError("multiple keyword arguments specified")
15661566

15671567
# Ensuring v is a symbolic expression and a valid limit variable
15681568
if not isinstance(v, Expression):
@@ -1586,7 +1586,7 @@ def limit(ex, *args, dir=None, taylor=False, algorithm='maxima', **kwargs):
15861586
raise ValueError("dir must be one of " + ", ".join(map(repr, dir_both)))
15871587

15881588
# Calling the appropriate backend based on effective_algorithm
1589-
l = None
1589+
l = None
15901590
if effective_algorithm == 'maxima':
15911591
if dir is None:
15921592
l = maxima.sr_limit(ex, v, a)
@@ -1603,7 +1603,7 @@ def limit(ex, *args, dir=None, taylor=False, algorithm='maxima', **kwargs):
16031603
l = maxima.sr_tlimit(ex, v, a, 'minus')
16041604
elif effective_algorithm == 'sympy':
16051605
import sympy
1606-
sympy_dir = '+-'
1606+
sympy_dir = '+-'
16071607
if dir in dir_plus:
16081608
sympy_dir = '+'
16091609
elif dir in dir_minus:
@@ -1620,25 +1620,25 @@ def limit(ex, *args, dir=None, taylor=False, algorithm='maxima', **kwargs):
16201620
fricas_dir_arg = '"left"'
16211621

16221622
if fricas_dir_arg:
1623-
l = fricas.limit(f, eq, fricas_dir_arg).sage()
1623+
l = fricas.limit(f, eq, fricas_dir_arg).sage()
16241624
else:
1625-
l_raw = fricas.limit(f, eq).sage()
1626-
if isinstance(l_raw, dict):
1627-
l = SR('und')
1628-
else:
1629-
l = l_raw
1625+
l_raw = fricas.limit(f, eq).sage()
1626+
if isinstance(l_raw, dict):
1627+
l = SR('und')
1628+
else:
1629+
l = l_raw
16301630
elif effective_algorithm == 'giac':
16311631
from sage.libs.giac.giac import libgiac
16321632
giac_v = v._giac_init_()
16331633
giac_a = a._giac_init_()
1634-
giac_dir_arg = 0 # Default for two-sided
1634+
giac_dir_arg = 0 # Default for two-sided
16351635
if dir in dir_plus:
16361636
giac_dir_arg = 1
16371637
elif dir in dir_minus:
16381638
giac_dir_arg = -1
16391639
l = libgiac.limit(ex, giac_v, giac_a, giac_dir_arg).sage()
16401640
elif effective_algorithm == 'mathematica_free':
1641-
# Ensuring mma_free_limit exists
1641+
# Ensuring mma_free_limit exists
16421642
l = mma_free_limit(ex, v, a, dir)
16431643
else:
16441644
raise ValueError("Unknown algorithm: %s" % effective_algorithm)
@@ -1647,6 +1647,7 @@ def limit(ex, *args, dir=None, taylor=False, algorithm='maxima', **kwargs):
16471647

16481648
return original_parent(l)
16491649

1650+
16501651
# lim is alias for limit
16511652
lim = limit
16521653

src/sage/combinat/posets/poset_examples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ def Crown(n, facade=None):
464464

465465
@staticmethod
466466
def DivisorLattice(n, facade=None):
467-
"""
467+
r"""
468468
Return the divisor lattice of an integer.
469469
470470
Elements of the lattice are divisors of `n`, and we have
@@ -539,7 +539,7 @@ def HessenbergPoset(H):
539539

540540
@staticmethod
541541
def IntegerCompositions(n):
542-
"""
542+
r"""
543543
Return the poset of integer compositions of the integer ``n``.
544544
545545
A composition of a positive integer `n` is a list of positive

0 commit comments

Comments
 (0)