Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit efc4fb8

Browse files
committedMar 14, 2025·
fix linter
1 parent eb840a4 commit efc4fb8

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed
 

‎src/sage/combinat/abstract_tree.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ def node_to_str(t):
14781478
while l_repr:
14791479
tr = l_repr.pop(0)
14801480
acc += UnicodeArt([" "]) + tr
1481-
if not len(l_repr):
1481+
if not l_repr:
14821482
lf_sep += "─" * (tr._root) + "╮"
14831483
ls_sep += " " * (tr._root) + "│"
14841484
else:

‎src/sage/graphs/generators/smallgraphs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3337,7 +3337,7 @@ def pcycle(i, s):
33373337
D.append(p)
33383338
vv = 'q%s' % (int(p[1]) + 1)
33393339
v = [v[-1] for v in H.neighbors(p) if v[:2] == vv]
3340-
if len(v):
3340+
if v:
33413341
s = int(v[0])
33423342
l += 1
33433343
map = H.relabel(range(50), return_map=True)

‎src/sage/interfaces/axiom.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ def _sage_(self):
843843
return ZZ(repr(self))
844844
elif type.startswith('Polynomial'):
845845
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
846-
base_ring = P(type.lstrip('Polynomial '))._sage_domain()
846+
base_ring = P(type.removeprefix('Polynomial '))._sage_domain()
847847
vars = str(self.variables())[1:-1]
848848
R = PolynomialRing(base_ring, vars)
849849
return R(self.unparsed_input_form())

‎src/sage/schemes/elliptic_curves/ell_finite_field.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3179,7 +3179,7 @@ def abs_products_under(bound):
31793179
"""
31803180
import heapq
31813181
hq = [(1, 1, -1)]
3182-
while len(hq):
3182+
while hq:
31833183
abs_n, n, idx = heapq.heappop(hq)
31843184
yield n
31853185
for nxt in range(idx + 1, len(S)):

‎src/sage/schemes/riemann_surfaces/riemann_surface.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3869,8 +3869,8 @@ def divisor_to_divisor_list(self, divisor, eps=None):
38693869
ys = []
38703870
for gi in gis:
38713871
# This test is a bit clunky, it surely can be made more efficient.
3872-
if len(ys):
3873-
ers = min([gi(y, r).abs() for y in ys])
3872+
if ys:
3873+
ers = min(gi(y, r).abs() for y in ys)
38743874
else:
38753875
ers = 1
38763876

‎src/sage/topology/cubical_complex.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1270,11 +1270,11 @@ def chain_complex(self, subcomplex=None, augmented=False,
12701270
# nonzero via a dictionary.
12711271
matrix_data = {}
12721272
col = 0
1273-
if len(old) and len(current):
1273+
if old and current:
12741274
for cube in current:
12751275
faces = cube.faces_as_pairs()
12761276
sign = 1
1277-
for (upper, lower) in faces:
1277+
for upper, lower in faces:
12781278
# trac 32203: use two "try/except" loops
12791279
# in case lower is in old but upper is not.
12801280
try:

0 commit comments

Comments
 (0)
Please sign in to comment.