Skip to content

Commit f53ae51

Browse files
author
Release Manager
committed
gh-39305: fixing some ruff PLR warnings here about useless return at the end of functions and methods ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. URL: #39305 Reported by: Frédéric Chapoton Reviewer(s): David Coudert
2 parents 056c849 + 7cf119c commit f53ae51

File tree

21 files changed

+8
-42
lines changed

21 files changed

+8
-42
lines changed

src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,6 @@ def check_base_ring_embedding(base_ring_embedding):
11161116
# initializing the basis extension (in case of more than 4 strands)
11171117
# ----------------------------------------------------------------------
11181118
self._init_basis_extension()
1119-
return
11201119

11211120
############################################################################
11221121
# --------------------------------------------------------------------------

src/sage/algebras/hecke_algebras/cubic_hecke_base_ring.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ def register_ring_hom(ring_hom):
105105
except ValueError:
106106
verbose('\nthe map:\n%s\ncannot be registered as conversion\n' % ring_hom)
107107

108-
return
109-
110108

111109
# -----------------------------------------------------------------------------
112110
# class for the Galois Group action on the generic extension ring corresponding
@@ -1005,11 +1003,10 @@ def __init__(self, names=('u', 'v', 'w', 's'), order='degrevlex', markov_trace_v
10051003
# Init of data used on demand
10061004
# ----------------------------------------------------------------------
10071005
self._mirror = None
1008-
return
10091006

1010-
############################################################################
1007+
# ########################################################################
10111008
# overloaded inherited methods
1012-
############################################################################
1009+
# ########################################################################
10131010
def _defining_names(self):
10141011
r"""
10151012
Return the generators of ``self`` as the defining names.

src/sage/categories/affine_weyl_groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def succ(pair):
130130
if (length < k and i == u1.first_descent(side='left') and
131131
u1.is_affine_grassmannian()):
132132
yield (u1, length + 1)
133-
return
133+
134134
return RecursivelyEnumeratedSet_forest(((self.one(), 0),), succ, algorithm='breadth',
135135
category=FiniteEnumeratedSets(),
136136
post_process=select_length)

src/sage/combinat/diagram_algebras.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4795,7 +4795,7 @@ def insert_pairing(cur, intervals):
47954795
# Singleton intervals are vertical lines,
47964796
# so we don't need to worry about them
47974797
if len(I) > 1 and I[0] < cur[0]:
4798-
cur, level[j] = level[j], cur
4798+
cur, level[j] = I, cur
47994799
level.append([cur[0]])
48004800
level.append([cur[1]])
48014801
break

src/sage/combinat/necklace.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,11 @@ def _fast_fixed_content(a, content, t, p, k, r, s, dll, equality=False):
360360
content[j] += 1
361361
j = dll.next(j)
362362
a[t - 1] = k - 1
363-
return
364363

365364

366-
################################
367-
# List Fixed Content Algorithm #
368-
################################
365+
# ###############################
366+
# List Fixed Content Algorithm #
367+
# ###############################
369368
def _lfc(content, equality=False):
370369
"""
371370
EXAMPLES::

src/sage/combinat/non_decreasing_parking_function.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,5 @@ def iterator_rec(n):
629629
return
630630
for res in iterator_rec(self.n):
631631
yield NonDecreasingParkingFunction(res)
632-
return
633632

634633
Element = NonDecreasingParkingFunction

src/sage/combinat/tableau.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8133,8 +8133,6 @@ def __iter__(self):
81338133

81348134
yield self.element_class(self, tableau)
81358135

8136-
return
8137-
81388136
def list(self):
81398137
r"""
81408138
Return a list of the standard Young tableaux of the specified shape.

src/sage/combinat/tableau_tuple.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4926,7 +4926,6 @@ def max_row_in_component(tab, r):
49264926
yield tableau_from_list(tab)
49274927

49284928
# all done!
4929-
return
49304929

49314930
def last(self):
49324931
r"""

src/sage/combinat/words/suffix_trees.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ def show(self, *args, **kwds):
501501
sage: t.show() # needs sage.plot
502502
"""
503503
self.plot(*args, **kwds).show()
504-
return
505504

506505
################################################################################
507506
# Suffix Trees
@@ -656,7 +655,6 @@ def _process_letter(self, letter):
656655
# set the active state
657656
s, k = self._canonize(s, (k, i))
658657
self._active_state = (s, (k, i+1))
659-
return
660658

661659
def _test_and_split(self, s, k_p, letter):
662660
r"""
@@ -918,7 +916,6 @@ def show(self, word_labels=None, *args, **kwds):
918916
sage: t.show(word_labels=False) # needs sage.plot
919917
"""
920918
self.plot(word_labels=word_labels, *args, **kwds).show()
921-
return
922919

923920
#####
924921
# Various methods
@@ -1115,7 +1112,6 @@ def to_explicit_suffix_tree(self):
11151112
end_state, r = self._test_and_split(s, (k, i-1), end_of_string)
11161113
# remove the end of string symbol from the word
11171114
self._letters.pop()
1118-
return
11191115

11201116
def edge_iterator(self):
11211117
r"""

src/sage/databases/cubic_hecke_db.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,6 @@ def update_basis_extensions(self, new_basis_extensions):
11531153
"""
11541154
self._data_library.update({self.section.basis_extensions: new_basis_extensions})
11551155
self.write(self.section.basis_extensions)
1156-
return
11571156

11581157

11591158
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)