diff --git a/src/sage/combinat/key_polynomial.py b/src/sage/combinat/key_polynomial.py index 1b3ae2a7108..89ff14683ec 100644 --- a/src/sage/combinat/key_polynomial.py +++ b/src/sage/combinat/key_polynomial.py @@ -42,7 +42,6 @@ from sage.misc.cachefunc import cached_method from sage.rings.integer_ring import ZZ from sage.rings.polynomial.infinite_polynomial_ring import InfinitePolynomialRing, InfinitePolynomialRing_sparse -from sage.rings.polynomial.infinite_polynomial_element import InfinitePolynomial from sage.rings.polynomial.multi_polynomial_ring_base import MPolynomialRing_base from sage.rings.polynomial.polynomial_ring import PolynomialRing_commutative from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing @@ -50,7 +49,7 @@ ##################################################################### -## Helper functions +# Helper functions def sorting_word(alpha): @@ -98,7 +97,7 @@ def sorting_word(alpha): ##################################################################### -## Divided difference operators +# Divided difference operators def divided_difference(f, i): @@ -248,7 +247,7 @@ def isobaric_divided_difference_bar(f, w): ##################################################################### -## Main classes +# Main classes class OperatorPolynomial(CombinatorialFreeModule.Element): diff --git a/src/sage/combinat/words/infinite_word.py b/src/sage/combinat/words/infinite_word.py index 0fab1f18891..3239735b53c 100644 --- a/src/sage/combinat/words/infinite_word.py +++ b/src/sage/combinat/words/infinite_word.py @@ -79,7 +79,7 @@ class InfiniteWord_class(Word_class): - def _repr_(self): + def _repr_(self) -> str: r""" Return a string representation of ``self``. diff --git a/src/sage/graphs/cycle_enumeration.py b/src/sage/graphs/cycle_enumeration.py index 6661c25eaa4..42e517eab58 100644 --- a/src/sage/graphs/cycle_enumeration.py +++ b/src/sage/graphs/cycle_enumeration.py @@ -206,7 +206,7 @@ def _all_cycles_iterator_vertex(self, vertex, starting_vertices=None, simple=Fal if weight_function(e) < 0: raise ValueError("negative weight is not allowed") - from heapq import heapify, heappop, heappush + from heapq import heappop, heappush heap_queue = [(0, [vertex])] if max_length is None: from sage.rings.infinity import Infinity diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py index 28db9a6c1ef..bfa562d111d 100644 --- a/src/sage/graphs/generators/families.py +++ b/src/sage/graphs/generators/families.py @@ -22,10 +22,10 @@ # **************************************************************************** from copy import copy +from itertools import combinations from math import sin, cos, pi + from sage.graphs.graph import Graph -from itertools import combinations -import subprocess def JohnsonGraph(n, k): diff --git a/src/sage/modular/abvar/finite_subgroup.py b/src/sage/modular/abvar/finite_subgroup.py index dda6f39e397..e3a92d753ad 100644 --- a/src/sage/modular/abvar/finite_subgroup.py +++ b/src/sage/modular/abvar/finite_subgroup.py @@ -100,19 +100,18 @@ import sage.rings.abc -from sage.misc.lazy_import import lazy_import +from sage.arith.functions import lcm +from sage.misc.misc_c import prod from sage.modular.abvar.torsion_point import TorsionPoint -from sage.modules.module import Module from sage.modules.free_module import FreeModule_generic -from sage.structure.gens_py import abelian_iterator -from sage.structure.sequence import Sequence -from sage.structure.richcmp import richcmp_method, richcmp +from sage.modules.module import Module from sage.rings.integer import Integer from sage.rings.integer_ring import ZZ from sage.rings.rational_field import QQ -from sage.arith.functions import lcm -from sage.misc.misc_c import prod from sage.structure.element import coercion_model +from sage.structure.gens_py import abelian_iterator +from sage.structure.richcmp import richcmp_method, richcmp +from sage.structure.sequence import Sequence @richcmp_method diff --git a/src/sage/schemes/elliptic_curves/cm.py b/src/sage/schemes/elliptic_curves/cm.py index 83c054173cd..7b9831feb6d 100644 --- a/src/sage/schemes/elliptic_curves/cm.py +++ b/src/sage/schemes/elliptic_curves/cm.py @@ -38,7 +38,6 @@ from sage.rings.rational_field import QQ from sage.rings.integer_ring import ZZ from sage.rings.integer_ring import IntegerRing -from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.misc.cachefunc import cached_function from sage.rings.number_field.number_field_element_base import NumberFieldElement_base diff --git a/src/sage/schemes/elliptic_curves/ell_rational_field.py b/src/sage/schemes/elliptic_curves/ell_rational_field.py index 6cae5d79f37..a8fd98da47c 100644 --- a/src/sage/schemes/elliptic_curves/ell_rational_field.py +++ b/src/sage/schemes/elliptic_curves/ell_rational_field.py @@ -74,7 +74,6 @@ from sage.rings.power_series_ring import PowerSeriesRing from sage.rings.rational_field import QQ from sage.rings.rational_field import RationalField -from sage.rings.real_mpfi import RealIntervalField from sage.rings.real_mpfr import RealField, RR from sage.structure.coerce import py_scalar_to_element from sage.structure.element import Element, RingElement diff --git a/src/sage/schemes/elliptic_curves/hom_fractional.py b/src/sage/schemes/elliptic_curves/hom_fractional.py index a8cd4b1dc14..42186649f32 100644 --- a/src/sage/schemes/elliptic_curves/hom_fractional.py +++ b/src/sage/schemes/elliptic_curves/hom_fractional.py @@ -86,7 +86,6 @@ - Lorenz Panny (2024) """ -from sage.structure.richcmp import op_EQ from sage.misc.cachefunc import cached_method from sage.structure.sequence import Sequence diff --git a/src/sage/schemes/hyperelliptic_curves/constructor.py b/src/sage/schemes/hyperelliptic_curves/constructor.py index c949b94dc36..f5f647d2df2 100644 --- a/src/sage/schemes/hyperelliptic_curves/constructor.py +++ b/src/sage/schemes/hyperelliptic_curves/constructor.py @@ -272,7 +272,6 @@ def HyperellipticCurve(f, h=None, names=None, PP=None, check_squarefree=True): from sage.rings.polynomial.multi_polynomial import MPolynomial if isinstance(f, MPolynomial) and len(f.parent().gens()) == 2: from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing - from sage.structure.element import get_coercion_model P = PolynomialRing(f.base_ring(), 'x') f, h = _parse_multivariate_defining_equation(f) f, h = P(f), P(h)