diff --git a/src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py b/src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py index 9aa6fa63ff2..faa4e90baf1 100644 --- a/src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py +++ b/src/sage/algebras/hecke_algebras/cubic_hecke_algebra.py @@ -1116,7 +1116,6 @@ def check_base_ring_embedding(base_ring_embedding): # initializing the basis extension (in case of more than 4 strands) # ---------------------------------------------------------------------- self._init_basis_extension() - return ############################################################################ # -------------------------------------------------------------------------- diff --git a/src/sage/algebras/hecke_algebras/cubic_hecke_base_ring.py b/src/sage/algebras/hecke_algebras/cubic_hecke_base_ring.py index 10381f64f35..1b011c68c61 100644 --- a/src/sage/algebras/hecke_algebras/cubic_hecke_base_ring.py +++ b/src/sage/algebras/hecke_algebras/cubic_hecke_base_ring.py @@ -105,8 +105,6 @@ def register_ring_hom(ring_hom): except ValueError: verbose('\nthe map:\n%s\ncannot be registered as conversion\n' % ring_hom) - return - # ----------------------------------------------------------------------------- # 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 # Init of data used on demand # ---------------------------------------------------------------------- self._mirror = None - return - ############################################################################ + # ######################################################################## # overloaded inherited methods - ############################################################################ + # ######################################################################## def _defining_names(self): r""" Return the generators of ``self`` as the defining names. diff --git a/src/sage/categories/affine_weyl_groups.py b/src/sage/categories/affine_weyl_groups.py index 71dfcd2350a..b904c96319e 100644 --- a/src/sage/categories/affine_weyl_groups.py +++ b/src/sage/categories/affine_weyl_groups.py @@ -130,7 +130,7 @@ def succ(pair): if (length < k and i == u1.first_descent(side='left') and u1.is_affine_grassmannian()): yield (u1, length + 1) - return + return RecursivelyEnumeratedSet_forest(((self.one(), 0),), succ, algorithm='breadth', category=FiniteEnumeratedSets(), post_process=select_length) diff --git a/src/sage/combinat/diagram_algebras.py b/src/sage/combinat/diagram_algebras.py index b929327a28e..841c9efe9d3 100644 --- a/src/sage/combinat/diagram_algebras.py +++ b/src/sage/combinat/diagram_algebras.py @@ -4795,7 +4795,7 @@ def insert_pairing(cur, intervals): # Singleton intervals are vertical lines, # so we don't need to worry about them if len(I) > 1 and I[0] < cur[0]: - cur, level[j] = level[j], cur + cur, level[j] = I, cur level.append([cur[0]]) level.append([cur[1]]) break diff --git a/src/sage/combinat/necklace.py b/src/sage/combinat/necklace.py index 3ac4bccf5e2..f3e8ccfd32d 100644 --- a/src/sage/combinat/necklace.py +++ b/src/sage/combinat/necklace.py @@ -360,12 +360,11 @@ def _fast_fixed_content(a, content, t, p, k, r, s, dll, equality=False): content[j] += 1 j = dll.next(j) a[t - 1] = k - 1 - return -################################ -# List Fixed Content Algorithm # -################################ +# ############################### +# List Fixed Content Algorithm # +# ############################### def _lfc(content, equality=False): """ EXAMPLES:: diff --git a/src/sage/combinat/non_decreasing_parking_function.py b/src/sage/combinat/non_decreasing_parking_function.py index dc6bf59e3e2..b8f9c9b825f 100644 --- a/src/sage/combinat/non_decreasing_parking_function.py +++ b/src/sage/combinat/non_decreasing_parking_function.py @@ -629,6 +629,5 @@ def iterator_rec(n): return for res in iterator_rec(self.n): yield NonDecreasingParkingFunction(res) - return Element = NonDecreasingParkingFunction diff --git a/src/sage/combinat/tableau.py b/src/sage/combinat/tableau.py index cb912e67409..6c2c4f6a2ab 100644 --- a/src/sage/combinat/tableau.py +++ b/src/sage/combinat/tableau.py @@ -8133,8 +8133,6 @@ def __iter__(self): yield self.element_class(self, tableau) - return - def list(self): r""" Return a list of the standard Young tableaux of the specified shape. diff --git a/src/sage/combinat/tableau_tuple.py b/src/sage/combinat/tableau_tuple.py index fd847c4ad1e..6c75106154b 100644 --- a/src/sage/combinat/tableau_tuple.py +++ b/src/sage/combinat/tableau_tuple.py @@ -4926,7 +4926,6 @@ def max_row_in_component(tab, r): yield tableau_from_list(tab) # all done! - return def last(self): r""" diff --git a/src/sage/combinat/words/suffix_trees.py b/src/sage/combinat/words/suffix_trees.py index 3249ce23235..86e2391c616 100644 --- a/src/sage/combinat/words/suffix_trees.py +++ b/src/sage/combinat/words/suffix_trees.py @@ -501,7 +501,6 @@ def show(self, *args, **kwds): sage: t.show() # needs sage.plot """ self.plot(*args, **kwds).show() - return ################################################################################ # Suffix Trees @@ -656,7 +655,6 @@ def _process_letter(self, letter): # set the active state s, k = self._canonize(s, (k, i)) self._active_state = (s, (k, i+1)) - return def _test_and_split(self, s, k_p, letter): r""" @@ -918,7 +916,6 @@ def show(self, word_labels=None, *args, **kwds): sage: t.show(word_labels=False) # needs sage.plot """ self.plot(word_labels=word_labels, *args, **kwds).show() - return ##### # Various methods @@ -1115,7 +1112,6 @@ def to_explicit_suffix_tree(self): end_state, r = self._test_and_split(s, (k, i-1), end_of_string) # remove the end of string symbol from the word self._letters.pop() - return def edge_iterator(self): r""" diff --git a/src/sage/databases/cubic_hecke_db.py b/src/sage/databases/cubic_hecke_db.py index bc5b9ba9bdd..3c75faf88ca 100644 --- a/src/sage/databases/cubic_hecke_db.py +++ b/src/sage/databases/cubic_hecke_db.py @@ -1153,7 +1153,6 @@ def update_basis_extensions(self, new_basis_extensions): """ self._data_library.update({self.section.basis_extensions: new_basis_extensions}) self.write(self.section.basis_extensions) - return # ----------------------------------------------------------------------------- diff --git a/src/sage/graphs/bipartite_graph.py b/src/sage/graphs/bipartite_graph.py index e21ec47e9cf..8d766556d24 100644 --- a/src/sage/graphs/bipartite_graph.py +++ b/src/sage/graphs/bipartite_graph.py @@ -1070,7 +1070,6 @@ def add_edge(self, u, v=None, label=None): # add the edge Graph.add_edge(self, u, v, label) - return def add_edges(self, edges, loops=True): """ diff --git a/src/sage/graphs/matching_covered_graph.py b/src/sage/graphs/matching_covered_graph.py index 9544c2e58f9..370fc1f9cad 100644 --- a/src/sage/graphs/matching_covered_graph.py +++ b/src/sage/graphs/matching_covered_graph.py @@ -2661,8 +2661,6 @@ def remove_loops(self, vertices=None): raise TypeError(f'\'{vertices.__class__.__name__}\' ' 'object is not iterable') - return - @doc_index('Miscellaneous methods') def update_matching(self, matching): r""" diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py index 94bdf4c12e5..3ca62e9f5e9 100644 --- a/src/sage/groups/cubic_braid.py +++ b/src/sage/groups/cubic_braid.py @@ -801,7 +801,6 @@ def __init__(self, names, cbg_type=None): self._classical_embedding = None # if self._classical_group different from self._classical_base_group self._centralizing_matrix = None # for Assion groups: element in classical base group commuting with self self._centralizing_element = None # image under nat. map of the former one in the proj. classical group - return def _repr_(self): r""" @@ -913,7 +912,6 @@ def _internal_test_attached_group(self, attached_group, tester): if self.is_finite() and self.strands() <= 7: # not realistic for larger number of strands att_grp_elem_back = self(att_grp_elem) tester.assertEqual(att_grp_elem_back, elem) - return def _test_classical_group(self, **options): r""" @@ -934,7 +932,6 @@ def _test_classical_group(self, **options): classic_grp = self.as_classical_group() if self.is_finite(): self._internal_test_attached_group(classic_grp, tester) - return def _test_permutation_group(self, **options): r""" @@ -955,7 +952,6 @@ def _test_permutation_group(self, **options): tester = self._tester(**options) permgrp = self.as_permutation_group() self._internal_test_attached_group(permgrp, tester) - return def _test_matrix_group(self, **options): r""" @@ -1024,7 +1020,6 @@ def _test_reflection_group(self, **options): tester = self._tester(**options) reflgrp = self.as_reflection_group() self._internal_test_attached_group(reflgrp, tester) - return # ------------------------------------------------------------------------------- # ------------------------------------------------------------------------------- @@ -1135,7 +1130,6 @@ def set_classical_realization(self, base_group, proj_group, centralizing_matrix, self._centralizing_matrix = centralizing_matrix self._centralizing_element = centralizing_element self._classical_embedding = embedding - return # ------------------------------------------------------------------------------- # local methods to set up the classical group (specific part) @@ -1210,7 +1204,6 @@ def transvec2mat(v, bas=bas, bform=bform, fact=1): transvec_matrices = [transvec2mat(v) for v in transvections] set_classical_realization(self, base_group, proj_group, centralizing_matrix, transvec_matrices) - return # ------------------------------------------------------------------------------- # Case for unitary groups @@ -1295,7 +1288,6 @@ def transvec2mat(v, bas=bas, bform=bform, fact=a): transvec_matrices = [transvec2mat(v) for v in transvections] set_classical_realization(self, base_group, proj_group, centralizing_matrix, transvec_matrices) - return # ---------------------------------------------------------------- # local functions declaration section finishes here @@ -1346,7 +1338,6 @@ def transvec2mat(v, bas=bas, bform=bform, fact=a): self._classical_embedding = classical_group if self._classical_invariant_form is None: self._classical_invariant_form = classical_group.ambient().invariant_form() - return def _element_constructor_(self, x, **kwds): r""" diff --git a/src/sage/interfaces/octave.py b/src/sage/interfaces/octave.py index 5241989836b..da26ea800b5 100644 --- a/src/sage/interfaces/octave.py +++ b/src/sage/interfaces/octave.py @@ -351,7 +351,6 @@ def quit(self, verbose=False): if self._expect is not None: if verbose: print("Exiting spawned %s process." % self) - return def _start(self): """ diff --git a/src/sage/lfunctions/dokchitser.py b/src/sage/lfunctions/dokchitser.py index b6524bce984..9e4154a6c07 100644 --- a/src/sage/lfunctions/dokchitser.py +++ b/src/sage/lfunctions/dokchitser.py @@ -287,7 +287,6 @@ def _instantiate_gp(cls): cls.__globals_re = re.compile( '([^a-zA-Z0-9_]|^)(%s)([^a-zA-Z0-9_]|$)' % '|'.join(cls.__globals)) - return @classmethod def _teardown_gp(cls, instance=None): diff --git a/src/sage/matrix/operation_table.py b/src/sage/matrix/operation_table.py index 89943f90b3b..58c53cfa1c7 100644 --- a/src/sage/matrix/operation_table.py +++ b/src/sage/matrix/operation_table.py @@ -777,7 +777,6 @@ def set_print_symbols(self, ascii, latex): raise ValueError('LaTeX symbol must be a string, not %s' % latex) self._ascii_symbol = ascii self._latex_symbol = latex - return None def column_keys(self): r""" @@ -931,7 +930,6 @@ def change_names(self, names): (1,2) """ self._width, self._names, self._name_dict = self._name_maker(names) - return None def matrix_of_variables(self): r""" diff --git a/src/sage/matroids/utilities.py b/src/sage/matroids/utilities.py index c9b903594c5..eb8b493c2e0 100644 --- a/src/sage/matroids/utilities.py +++ b/src/sage/matroids/utilities.py @@ -792,7 +792,6 @@ def split_vertex(G, u, v=None, edges=None): G.delete_edge(e) # This modifies the graph without needing to return anything - return def cmp_elements_key(x): diff --git a/src/sage/plot/hyperbolic_arc.py b/src/sage/plot/hyperbolic_arc.py index 904576f79b2..4aa87d4ad22 100644 --- a/src/sage/plot/hyperbolic_arc.py +++ b/src/sage/plot/hyperbolic_arc.py @@ -167,7 +167,6 @@ def _bezier_path(self, z0, z1, model, first=False): self.path.append(points[N: N + 3]) N += 3 self.last_plotted = "arc" - return class HyperbolicArc(HyperbolicArcCore): diff --git a/src/sage/quadratic_forms/quadratic_form__neighbors.py b/src/sage/quadratic_forms/quadratic_form__neighbors.py index d4d579409d3..b63fbda3b60 100644 --- a/src/sage/quadratic_forms/quadratic_form__neighbors.py +++ b/src/sage/quadratic_forms/quadratic_form__neighbors.py @@ -327,7 +327,7 @@ def neighbor_iteration(seeds, p, mass=None, max_classes=None, def p_divisible_vectors(Q, max_neighbors): yield from iter(v.lift() for v in Q.orbits_lines_mod_p(p) if v != 0 and Q(v.lift()).valuation(p) > 0) - return + elif algorithm == 'exhaustion': def p_divisible_vectors(Q, max_neighbors): k = 0 diff --git a/src/sage/rings/lazy_series.py b/src/sage/rings/lazy_series.py index b670cce965c..6a4fea857a4 100644 --- a/src/sage/rings/lazy_series.py +++ b/src/sage/rings/lazy_series.py @@ -4948,7 +4948,6 @@ def compute_coefficients(self, i): """ from sage.misc.superseded import deprecation deprecation(32367, "the method compute_coefficients obsolete and has no effect.") - return def _im_gens_(self, codomain, im_gens, base_map=None): """ diff --git a/src/sage/rings/tests.py b/src/sage/rings/tests.py index 3796ef7b276..09e0d585078 100644 --- a/src/sage/rings/tests.py +++ b/src/sage/rings/tests.py @@ -501,4 +501,3 @@ def test_karatsuba_multiplication(base_ring, maxdeg1, maxdeg2, msg += "and\n" msg += f"{sage_input(g)}" raise ValueError(msg) - return