diff --git a/build/pkgs/configure/checksums.ini b/build/pkgs/configure/checksums.ini index 06492185c15..45c84606a18 100644 --- a/build/pkgs/configure/checksums.ini +++ b/build/pkgs/configure/checksums.ini @@ -1,4 +1,4 @@ tarball=configure-VERSION.tar.gz -sha1=b5a2cfbb85e9d1afd3c151429525944f1e0ca84f -md5=8cf9a8e717fe11a7c6fb7aa41975a7a1 -cksum=2226307451 +sha1=7f35111c9a2aeb985580f13c2f1f72b2219ffcb1 +md5=30cf7cce73540a45384762cea5da5f62 +cksum=2110985588 diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt index 1668ffac530..250df17642e 100644 --- a/build/pkgs/configure/package-version.txt +++ b/build/pkgs/configure/package-version.txt @@ -1 +1 @@ -413ff13c54c4738b14d64eb7e7e6b2d06439d12c +b393ee3e8e5501fd7e9101d884c743567df1816d diff --git a/src/sage/combinat/abstract_tree.py b/src/sage/combinat/abstract_tree.py index 5d0caa16a48..3054ef00995 100644 --- a/src/sage/combinat/abstract_tree.py +++ b/src/sage/combinat/abstract_tree.py @@ -2085,7 +2085,7 @@ def __init__(self, parent, children, label=None, check=True): """ # We must initialize the label before the subtrees to allows rooted # trees canonization. Indeed it needs that ``self``._hash_() is working - # at the end of the call super(..., self).__init__(...) + # at the end of the call super().__init__(...) if isinstance(children, AbstractLabelledTree): if label is None: self._label = children._label @@ -2093,7 +2093,7 @@ def __init__(self, parent, children, label=None, check=True): self._label = label else: self._label = label - super(AbstractLabelledTree, self).__init__(parent, children, check=check) + super().__init__(parent, children, check=check) def _repr_(self): """ @@ -2211,8 +2211,7 @@ def __eq__(self, other): sage: t1 == t2 False """ - return (super(AbstractLabelledTree, self).__eq__(other) and - self._label == other._label) + return super().__eq__(other) and self._label == other._label def _hash_(self): """ diff --git a/src/sage/combinat/baxter_permutations.py b/src/sage/combinat/baxter_permutations.py index 0e3c722f480..382e4abcdab 100644 --- a/src/sage/combinat/baxter_permutations.py +++ b/src/sage/combinat/baxter_permutations.py @@ -81,7 +81,7 @@ def __init__(self, n): self.element_class = Permutations(n).element_class self._n = ZZ(n) from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets - super(BaxterPermutations_size, self).__init__(category=FiniteEnumeratedSets()) + super().__init__(category=FiniteEnumeratedSets()) def _repr_(self): """ diff --git a/src/sage/combinat/blob_algebra.py b/src/sage/combinat/blob_algebra.py index 3731b8c973e..5da88de497f 100644 --- a/src/sage/combinat/blob_algebra.py +++ b/src/sage/combinat/blob_algebra.py @@ -429,7 +429,7 @@ def __classcall_private__(cls, k, q1, q2, q3, base_ring=None, prefix='B'): q1 = base_ring(q1) q2 = base_ring(q2) q3 = base_ring(q3) - return super(BlobAlgebra, cls).__classcall__(cls, k, q1, q2, q3, base_ring, prefix) + return super().__classcall__(cls, k, q1, q2, q3, base_ring, prefix) def __init__(self, k, q1, q2, q3, base_ring, prefix): r""" diff --git a/src/sage/combinat/chas/fsym.py b/src/sage/combinat/chas/fsym.py index d618f44d3fd..a2dfd12f621 100644 --- a/src/sage/combinat/chas/fsym.py +++ b/src/sage/combinat/chas/fsym.py @@ -158,7 +158,7 @@ def coerce_base_ring(self, x): # Otherwise lift that basis up and then coerce over target = getattr(FSym, R._realization_name())() return self._coerce_map_via([target], R) - return super(FSymBasis_abstract, self)._coerce_map_from_(R) + return super()._coerce_map_from_(R) def some_elements(self): r""" @@ -633,7 +633,7 @@ def R_to_G_on_basis(alpha): if descent_composition(t) == alpha) return ribbon.module_morphism(R_to_G_on_basis, codomain=self) return self._coerce_map_via([ribbon], R) - return super(FreeSymmetricFunctions.Fundamental, self)._coerce_map_from_(R) + return super()._coerce_map_from_(R) def dual_basis(self): r""" @@ -963,7 +963,7 @@ def s_to_F_on_basis(mu): return self.sum_of_monomials(StandardTableaux(mu)) return s.module_morphism(s_to_F_on_basis, codomain=self) return self._coerce_map_via([s], R) - return super(FreeSymmetricFunctions_Dual.FundamentalDual, self)._coerce_map_from_(R) + return super()._coerce_map_from_(R) def dual_basis(self): r""" diff --git a/src/sage/combinat/chas/wqsym.py b/src/sage/combinat/chas/wqsym.py index 8a8ee533e8e..238d0281030 100644 --- a/src/sage/combinat/chas/wqsym.py +++ b/src/sage/combinat/chas/wqsym.py @@ -233,7 +233,7 @@ def coerce_base_ring(self, x): # Otherwise lift that basis up and then coerce over target = getattr(self.realization_of(), R._basis_name)() return self._coerce_map_via([target], R) - return super(WQSymBasis_abstract, self)._coerce_map_from_(R) + return super()._coerce_map_from_(R) @cached_method def an_element(self): diff --git a/src/sage/combinat/colored_permutations.py b/src/sage/combinat/colored_permutations.py index 3a3c8f0ab87..d3bfadcccfd 100644 --- a/src/sage/combinat/colored_permutations.py +++ b/src/sage/combinat/colored_permutations.py @@ -727,13 +727,13 @@ def _coerce_map_from_(self, C): False """ if isinstance(C, Permutations) and C.n == self._n: - return lambda P, x: P.element_class(P, [P._C.zero()]*P._n, x) + return lambda P, x: P.element_class(P, [P._C.zero()] * P._n, x) if self._m == 2 and isinstance(C, SignedPermutations) and C._n == self._n: return lambda P, x: P.element_class(P, [P._C.zero() if v == 1 else P._C.one() for v in x._colors], x._perm) - return super(ColoredPermutations, self)._coerce_map_from_(C) + return super()._coerce_map_from_(C) def __iter__(self): """ diff --git a/src/sage/combinat/combinat.py b/src/sage/combinat/combinat.py index 48475d117dc..e5ad98ea4ab 100644 --- a/src/sage/combinat/combinat.py +++ b/src/sage/combinat/combinat.py @@ -1572,7 +1572,7 @@ def __init__(self, parent, *args, **kwds): L, = kwds.values() else: raise TypeError("__init__() takes exactly 2 arguments ({} given)".format(1 + len(args) + len(kwds))) - super(CombinatorialElement, self).__init__(L) + super().__init__(L) super(CombinatorialObject, self).__init__(parent) diff --git a/src/sage/combinat/composition.py b/src/sage/combinat/composition.py index 46a6be10fad..cc709bc5091 100644 --- a/src/sage/combinat/composition.py +++ b/src/sage/combinat/composition.py @@ -1907,7 +1907,7 @@ def __classcall_private__(cls, n): sage: C is C3 True """ - return super(Compositions_n, cls).__classcall__(cls, Integer(n)) + return super().__classcall__(cls, Integer(n)) def __init__(self, n): """ diff --git a/src/sage/combinat/composition_tableau.py b/src/sage/combinat/composition_tableau.py index 64c98d81bf5..0092a043e8a 100644 --- a/src/sage/combinat/composition_tableau.py +++ b/src/sage/combinat/composition_tableau.py @@ -448,7 +448,7 @@ def __init__(self, **kwds): kwds.pop('max_entry') else: self.max_entry = None - super(CompositionTableaux, self).__init__(**kwds) + super().__init__(**kwds) Element = CompositionTableau @@ -588,11 +588,11 @@ def __init__(self, n, max_entry=None): """ if max_entry is None: max_entry = n - super(CompositionTableaux_size, self).__init__(max_entry=max_entry, - category=FiniteEnumeratedSets()) + super().__init__(max_entry=max_entry, + category=FiniteEnumeratedSets()) self.size = n - def __contains__(self,x): + def __contains__(self, x): r""" TESTS:: @@ -677,7 +677,7 @@ class CompositionTableaux_shape(CompositionTableaux): """ def __init__(self, comp, max_entry=None): """ - Initialize ``sefl``. + Initialize ``self``. TESTS:: @@ -689,8 +689,8 @@ def __init__(self, comp, max_entry=None): """ if max_entry is None: max_entry = sum(comp) - super(CompositionTableaux_shape, self).__init__(max_entry = max_entry, - category = FiniteEnumeratedSets()) + super().__init__(max_entry=max_entry, + category=FiniteEnumeratedSets()) self.shape = comp def __iter__(self): diff --git a/src/sage/combinat/derangements.py b/src/sage/combinat/derangements.py index e8e25e9cd79..00bdeca728c 100644 --- a/src/sage/combinat/derangements.py +++ b/src/sage/combinat/derangements.py @@ -146,8 +146,8 @@ def __classcall_private__(cls, x): True """ if x in ZZ: - x = list(range(1, x + 1)) - return super(Derangements, cls).__classcall__(cls, tuple(x)) + x = tuple(range(1, x + 1)) + return super().__classcall__(cls, tuple(x)) def __init__(self, x): """ diff --git a/src/sage/combinat/designs/twographs.py b/src/sage/combinat/designs/twographs.py index c0e15ed24fe..11211ffbefb 100644 --- a/src/sage/combinat/designs/twographs.py +++ b/src/sage/combinat/designs/twographs.py @@ -169,7 +169,8 @@ def complement(self): sage: is_twograph(pc) True """ - return super(TwoGraph, self).complement(uniform=True) + return super().complement(uniform=True) + def taylor_twograph(q): r""" diff --git a/src/sage/combinat/dyck_word.py b/src/sage/combinat/dyck_word.py index f8a7bd6952c..7c1c5bc5878 100644 --- a/src/sage/combinat/dyck_word.py +++ b/src/sage/combinat/dyck_word.py @@ -491,7 +491,7 @@ def _repr_list(self) -> str: sage: DyckWord('(())') [1, 1, 0, 0] """ - return super(DyckWord, self)._repr_() + return super()._repr_() def _repr_lattice(self, type=None, labelling=None, underpath=True) -> str: r""" diff --git a/src/sage/combinat/fqsym.py b/src/sage/combinat/fqsym.py index 97b8cd6455a..28244d5b684 100644 --- a/src/sage/combinat/fqsym.py +++ b/src/sage/combinat/fqsym.py @@ -160,7 +160,7 @@ def G_to_G_on_basis(t): else: return self.coerce_map_from(G) * phi - return super(FQSymBasis_abstract, self)._coerce_map_from_(R) + return super()._coerce_map_from_(R) @cached_method def an_element(self): @@ -476,7 +476,7 @@ def __getitem__(self, r): r = list(r) elif r == 1: r = [1] - return super(FreeQuasisymmetricFunctions.F, self).__getitem__(r) + return super().__getitem__(r) def degree_on_basis(self, t): """ @@ -787,7 +787,7 @@ def __getitem__(self, r): r = list(r) elif r == 1: r = [1] - return super(FreeQuasisymmetricFunctions.G, self).__getitem__(r) + return super().__getitem__(r) def _G_to_F_on_basis(self, w): r""" @@ -1005,7 +1005,7 @@ def __getitem__(self, r): r = list(r) elif r == 1: r = [1] - return super(FreeQuasisymmetricFunctions.M, self).__getitem__(r) + return super().__getitem__(r) def _F_to_M_on_basis(self, w): r""" diff --git a/src/sage/combinat/free_dendriform_algebra.py b/src/sage/combinat/free_dendriform_algebra.py index ffac8fd2452..04b8cf1208e 100644 --- a/src/sage/combinat/free_dendriform_algebra.py +++ b/src/sage/combinat/free_dendriform_algebra.py @@ -139,8 +139,7 @@ def __classcall_private__(cls, R, names=None): if R not in Rings(): raise TypeError("argument R must be a ring") - return super(FreeDendriformAlgebra, cls).__classcall__(cls, R, - names) + return super().__classcall__(cls, R, names) def __init__(self, R, names=None): """ diff --git a/src/sage/combinat/free_prelie_algebra.py b/src/sage/combinat/free_prelie_algebra.py index 8fe464d34bd..2354cbbe576 100644 --- a/src/sage/combinat/free_prelie_algebra.py +++ b/src/sage/combinat/free_prelie_algebra.py @@ -193,7 +193,7 @@ def __classcall_private__(cls, R, names=None): if R not in Rings(): raise TypeError("argument R must be a ring") - return super(FreePreLieAlgebra, cls).__classcall__(cls, R, names) + return super().__classcall__(cls, R, names) def __init__(self, R, names=None): """ diff --git a/src/sage/combinat/fully_commutative_elements.py b/src/sage/combinat/fully_commutative_elements.py index e85f7be7672..b8f26d8ba8b 100644 --- a/src/sage/combinat/fully_commutative_elements.py +++ b/src/sage/combinat/fully_commutative_elements.py @@ -923,7 +923,7 @@ def __classcall_private__(cls, data): group = data else: group = CoxeterGroup(data) - return super(cls, FullyCommutativeElements).__classcall__(cls, group) + return super().__classcall__(cls, group) def __init__(self, coxeter_group): r""" diff --git a/src/sage/combinat/gelfand_tsetlin_patterns.py b/src/sage/combinat/gelfand_tsetlin_patterns.py index 37e964293dc..a210a4cc370 100644 --- a/src/sage/combinat/gelfand_tsetlin_patterns.py +++ b/src/sage/combinat/gelfand_tsetlin_patterns.py @@ -642,7 +642,7 @@ def __classcall_private__(cls, n=None, k=None, strict=False, top_row=None): if n is not None and n != len(top_row): raise ValueError("n must be the length of the specified top row") return GelfandTsetlinPatternsTopRow(top_row, strict) - return super(GelfandTsetlinPatterns, cls).__classcall__(cls, n, k, strict) + return super().__classcall__(cls, n, k, strict) def __init__(self, n, k, strict): """ diff --git a/src/sage/combinat/grossman_larson_algebras.py b/src/sage/combinat/grossman_larson_algebras.py index 35d49447c64..8fcf8a2e5ec 100644 --- a/src/sage/combinat/grossman_larson_algebras.py +++ b/src/sage/combinat/grossman_larson_algebras.py @@ -161,7 +161,7 @@ def __classcall_private__(cls, R, names=None): if R not in Rings(): raise TypeError("argument R must be a ring") - return super(GrossmanLarsonAlgebra, cls).__classcall__(cls, R, names) + return super().__classcall__(cls, R, names) def __init__(self, R, names=None): """ diff --git a/src/sage/combinat/hillman_grassl.py b/src/sage/combinat/hillman_grassl.py index a942b8072b1..1abbc3d56bd 100644 --- a/src/sage/combinat/hillman_grassl.py +++ b/src/sage/combinat/hillman_grassl.py @@ -198,7 +198,7 @@ def conjugate(self): sage: c.parent() Weak Reverse Plane Partitions """ - C = super(WeakReversePlanePartition, self).conjugate() + C = super().conjugate() return WeakReversePlanePartition(C) def hillman_grassl_inverse(self): @@ -437,7 +437,7 @@ def __classcall_private__(cls, shape=None, **kwds): # from sage.combinat.partition import Partition # return RibbonShapedTableaux_shape(Partition(shape)) - return super(WeakReversePlanePartitions, cls).__classcall__(cls, **kwds) + return super().__classcall__(cls, **kwds) def __init__(self): """ diff --git a/src/sage/combinat/integer_vector.py b/src/sage/combinat/integer_vector.py index ea9be362fdc..ee73284a59c 100644 --- a/src/sage/combinat/integer_vector.py +++ b/src/sage/combinat/integer_vector.py @@ -1096,7 +1096,7 @@ def __classcall_private__(cls, n, comp): sage: IntegerVectors(4, [2,1]) is IntegerVectors(int(4), (2,1)) True """ - return super(IntegerVectors_nnondescents, cls).__classcall__(cls, n, tuple(comp)) + return super().__classcall__(cls, n, tuple(comp)) def __init__(self, n, comp): """ diff --git a/src/sage/combinat/k_regular_sequence.py b/src/sage/combinat/k_regular_sequence.py index c09134f339c..ae5e573fd0b 100644 --- a/src/sage/combinat/k_regular_sequence.py +++ b/src/sage/combinat/k_regular_sequence.py @@ -152,8 +152,7 @@ def __init__(self, parent, mu, left=None, right=None): :doc:`k-regular sequence `, :class:`kRegularSequenceSpace`. """ - super(kRegularSequence, self).__init__( - parent=parent, mu=mu, left=left, right=right) + super().__init__(parent=parent, mu=mu, left=left, right=right) def _repr_(self): r""" @@ -828,8 +827,8 @@ def __normalize__(cls, k, coefficient_ring, **kwds): {0, 1} """ from sage.arith.srange import srange - nargs = super(kRegularSequenceSpace, cls).__normalize__( - coefficient_ring, alphabet=srange(k), **kwds) + nargs = super().__normalize__(coefficient_ring, + alphabet=srange(k), **kwds) return (k,) + nargs def __init__(self, k, *args, **kwds): @@ -863,7 +862,7 @@ def __init__(self, k, *args, **kwds): :class:`kRegularSequence`. """ self.k = k - super(kRegularSequenceSpace, self).__init__(*args, **kwds) + super().__init__(*args, **kwds) def __reduce__(self): r""" diff --git a/src/sage/combinat/knutson_tao_puzzles.py b/src/sage/combinat/knutson_tao_puzzles.py index bd5ca49fc5b..b29990d51a0 100644 --- a/src/sage/combinat/knutson_tao_puzzles.py +++ b/src/sage/combinat/knutson_tao_puzzles.py @@ -1986,7 +1986,7 @@ def __classcall_private__(cls, puzzle_pieces, max_letter=None): puzzle_pieces = BK_pieces(max_letter) else: raise ValueError("max_letter needs to be specified") - return super(KnutsonTaoPuzzleSolver, cls).__classcall__(cls, puzzle_pieces) + return super().__classcall__(cls, puzzle_pieces) def __call__(self, lamda, mu, algorithm='strips'): r""" diff --git a/src/sage/combinat/lr_tableau.py b/src/sage/combinat/lr_tableau.py index 3a24b1007d3..8e8fefaa1c5 100644 --- a/src/sage/combinat/lr_tableau.py +++ b/src/sage/combinat/lr_tableau.py @@ -97,7 +97,7 @@ def __init__(self, parent, t): """ self._shape = parent._shape self._weight = parent._weight - super(LittlewoodRichardsonTableau, self).__init__(parent, list(t)) + super().__init__(parent, list(t)) def check(self): r""" @@ -127,7 +127,7 @@ def check(self): ... ValueError: weight of the parent does not agree with the weight of the tableau """ - super(LittlewoodRichardsonTableau, self).check() + super().check() if not [i for a in self.parent()._weight for i in a] == self.weight(): raise ValueError("weight of the parent does not agree " "with the weight of the tableau") @@ -135,6 +135,7 @@ def check(self): raise ValueError("shape of the parent does not agree " "with the shape of the tableau") + class LittlewoodRichardsonTableaux(SemistandardTableaux): r""" Littlewood-Richardson tableaux. diff --git a/src/sage/combinat/ncsym/bases.py b/src/sage/combinat/ncsym/bases.py index 398883f1d80..6d8b1b86185 100644 --- a/src/sage/combinat/ncsym/bases.py +++ b/src/sage/combinat/ncsym/bases.py @@ -45,7 +45,7 @@ def _element_constructor_(self, x): """ if isinstance(x, (list, tuple)): x = SetPartition(x) - return super(NCSymBasis_abstract, self)._element_constructor_(x) + return super()._element_constructor_(x) class NCSymOrNCSymDualBases(Category_realization_of_parent): diff --git a/src/sage/combinat/necklace.py b/src/sage/combinat/necklace.py index bbfb5c215d2..a065cabdd2c 100644 --- a/src/sage/combinat/necklace.py +++ b/src/sage/combinat/necklace.py @@ -87,11 +87,9 @@ def __classcall_private__(cls, content): sage: Necklaces([2,1,1]) is Necklaces(Composition([2,1,1])) True """ - if isinstance(content, Composition): - return super(Necklaces_evaluation, cls).__classcall__(cls, content) - else: + if not isinstance(content, Composition): content = Composition(content) - return super(Necklaces_evaluation, cls).__classcall__(cls, content) + return super().__classcall__(cls, content) def __init__(self, content): r""" diff --git a/src/sage/combinat/ordered_tree.py b/src/sage/combinat/ordered_tree.py index acb9eddc652..8157b4a95a3 100644 --- a/src/sage/combinat/ordered_tree.py +++ b/src/sage/combinat/ordered_tree.py @@ -1021,7 +1021,7 @@ def __init__(self, size): sage: TestSuite(OrderedTrees_size(0)).run() sage: for i in range(6): TestSuite(OrderedTrees_size(i)).run() """ - super(OrderedTrees_size, self).__init__(category=FiniteEnumeratedSets()) + super().__init__(category=FiniteEnumeratedSets()) self._size = size def _repr_(self): diff --git a/src/sage/combinat/perfect_matching.py b/src/sage/combinat/perfect_matching.py index 975a682b233..bde046e0d8b 100644 --- a/src/sage/combinat/perfect_matching.py +++ b/src/sage/combinat/perfect_matching.py @@ -603,7 +603,7 @@ def __classcall_private__(cls, s): except AttributeError: pass s = frozenset(s) - return super(PerfectMatchings, cls).__classcall__(cls, s) + return super().__classcall__(cls, s) def _repr_(self): """ diff --git a/src/sage/combinat/plane_partition.py b/src/sage/combinat/plane_partition.py index 4413916886a..49edf8abdea 100644 --- a/src/sage/combinat/plane_partition.py +++ b/src/sage/combinat/plane_partition.py @@ -806,7 +806,7 @@ def __classcall_private__(cls, box_size): sage: P1 is P2 True """ - return super(PlanePartitions, cls).__classcall__(cls, tuple(box_size)) + return super().__classcall__(cls, tuple(box_size)) def __init__(self, box_size): r""" diff --git a/src/sage/combinat/posets/cartesian_product.py b/src/sage/combinat/posets/cartesian_product.py index 473024e80b9..e8c602895cd 100644 --- a/src/sage/combinat/posets/cartesian_product.py +++ b/src/sage/combinat/posets/cartesian_product.py @@ -111,8 +111,7 @@ def __init__(self, sets, category, order=None, **kwargs): if not isinstance(category, tuple): category = (category,) category = Category.join(category + (Posets(),)) - super(CartesianProductPoset, self).__init__( - sets, category, **kwargs) + super().__init__(sets, category, **kwargs) def le(self, left, right): r""" diff --git a/src/sage/combinat/posets/incidence_algebras.py b/src/sage/combinat/posets/incidence_algebras.py index 65dc086118a..2d621cef967 100644 --- a/src/sage/combinat/posets/incidence_algebras.py +++ b/src/sage/combinat/posets/incidence_algebras.py @@ -117,7 +117,7 @@ def _coerce_map_from_(self, R): """ if isinstance(R, ReducedIncidenceAlgebra) and R._ambient is self: return copy(R.lift) - return super(IncidenceAlgebra, self)._coerce_map_from_(R) + return super()._coerce_map_from_(R) def reduced_subalgebra(self, prefix='R'): """ diff --git a/src/sage/combinat/posets/linear_extensions.py b/src/sage/combinat/posets/linear_extensions.py index 8c2a4fa3d0a..d47c4c56179 100644 --- a/src/sage/combinat/posets/linear_extensions.py +++ b/src/sage/combinat/posets/linear_extensions.py @@ -453,7 +453,7 @@ def __classcall_private__(cls, poset, facade=False): sage: L is LinearExtensionsOfPoset(P,facade=False) True """ - return super(LinearExtensionsOfPoset, cls).__classcall__(cls, poset, facade=facade) + return super().__classcall__(cls, poset, facade=facade) def __init__(self, poset, facade): """ @@ -641,7 +641,7 @@ def __contains__(self, obj): """ if not self._is_facade: - return super(LinearExtensionsOfPoset, self).__contains__(obj) + return super().__contains__(obj) return (isinstance(obj, (list, tuple)) and self.poset().is_linear_extension(obj)) diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py index d79dfaf67ea..0ec9fdfee20 100644 --- a/src/sage/combinat/posets/posets.py +++ b/src/sage/combinat/posets/posets.py @@ -1000,10 +1000,10 @@ def __classcall__(cls, hasse_diagram, elements=None, category=None, facade=None, if category is not None and category.is_subcategory(Sets().Facade()): category = category._without_axiom("Facade") category = Category.join([FinitePosets().or_subcategory(category), FiniteEnumeratedSets()]) - return super(FinitePoset, cls).__classcall__(cls, hasse_diagram=hasse_diagram, - elements=elements, - category=category, facade=facade, - key=key) + return super().__classcall__(cls, hasse_diagram=hasse_diagram, + elements=elements, + category=category, facade=facade, + key=key) def __init__(self, hasse_diagram, elements, category, facade, key): r""" diff --git a/src/sage/combinat/rooted_tree.py b/src/sage/combinat/rooted_tree.py index ace4009f3ef..b28b1b89b9e 100644 --- a/src/sage/combinat/rooted_tree.py +++ b/src/sage/combinat/rooted_tree.py @@ -633,7 +633,7 @@ def __init__(self, n): sage: for i in range(1, 6): ....: TestSuite(RootedTrees(i)).run() """ - super(RootedTrees_size, self).__init__(category=FiniteEnumeratedSets()) + super().__init__(category=FiniteEnumeratedSets()) self._n = n def _repr_(self): diff --git a/src/sage/combinat/rsk.py b/src/sage/combinat/rsk.py index f5a3432b208..2400ef86fdd 100644 --- a/src/sage/combinat/rsk.py +++ b/src/sage/combinat/rsk.py @@ -613,9 +613,8 @@ def _backward_format_output(self, lower_row, upper_row, output, raise TypeError("p must be standard to have a valid permutation as output") from sage.combinat.permutation import Permutation return Permutation(reversed(lower_row)) - else: - return super(RuleRSK, self)._backward_format_output(lower_row, upper_row, output, - p_is_standard, q_is_standard) + return super()._backward_format_output(lower_row, upper_row, output, + p_is_standard, q_is_standard) class RuleEG(Rule): @@ -798,8 +797,8 @@ def _backward_format_output(self, lower_row, upper_row, output, from sage.combinat.permutation import Permutations return Permutations(n).from_reduced_word(list(lower_row)) else: - return super(RuleEG, self)._backward_format_output(lower_row, upper_row, output, - p_is_standard, q_is_standard) + return super()._backward_format_output(lower_row, upper_row, output, + p_is_standard, q_is_standard) class RuleHecke(Rule): @@ -1483,8 +1482,8 @@ def _backward_format_output(self, lower_row, upper_row, output, from sage.combinat.permutation import Permutation return Permutation(reversed(lower_row)) else: - return super(RuleDualRSK, self)._backward_format_output(lower_row, upper_row, output, - p_is_standard, q_is_standard) + return super()._backward_format_output(lower_row, upper_row, output, + p_is_standard, q_is_standard) def _forward_format_output(self, p, q, check_standard): r""" diff --git a/src/sage/combinat/set_partition.py b/src/sage/combinat/set_partition.py index 3e426f16e85..fdd394e1369 100644 --- a/src/sage/combinat/set_partition.py +++ b/src/sage/combinat/set_partition.py @@ -2735,7 +2735,7 @@ def __classcall_private__(cls, s): sage: S1 is S2, S1 is S3 (True, True) """ - return super(SetPartitions_set, cls).__classcall__(cls, frozenset(s)) + return super().__classcall__(cls, frozenset(s)) def __init__(self, s): """ @@ -2914,7 +2914,7 @@ def __classcall_private__(cls, s, parts): """ if isinstance(s, (int, Integer)): s = list(range(1, s + 1)) - return super(SetPartitions_setparts, cls).__classcall__(cls, frozenset(s), Partition(parts)) + return super().__classcall__(cls, frozenset(s), Partition(parts)) def __init__(self, s, parts): """ @@ -3170,7 +3170,7 @@ def __classcall_private__(cls, s, k): sage: S1 is S2, S1 is S3 (True, True) """ - return super(SetPartitions_setn, cls).__classcall__(cls, frozenset(s), k) + return super().__classcall__(cls, frozenset(s), k) def __init__(self, s, k): """ diff --git a/src/sage/combinat/set_partition_ordered.py b/src/sage/combinat/set_partition_ordered.py index 9e648ed722e..f2f201eb7f2 100644 --- a/src/sage/combinat/set_partition_ordered.py +++ b/src/sage/combinat/set_partition_ordered.py @@ -1398,8 +1398,8 @@ def _coerce_map_from_(self, X): if X is self: return True if isinstance(X, OrderedSetPartitions): - return X._set == frozenset(range(1,len(X._set)+1)) - return super(OrderedSetPartitions_all, self)._coerce_map_from_(X) + return X._set == frozenset(range(1, len(X._set) + 1)) + return super()._coerce_map_from_(X) def _repr_(self): """ diff --git a/src/sage/combinat/sf/dual.py b/src/sage/combinat/sf/dual.py index 677a8dcfd3f..4ec49461f59 100644 --- a/src/sage/combinat/sf/dual.py +++ b/src/sage/combinat/sf/dual.py @@ -277,7 +277,7 @@ def _repr_(self): Dual basis to Symmetric Functions over Rational Field in the monomial basis with respect to the Hall scalar product """ if hasattr(self, "_basis"): - return super(SymmetricFunctionAlgebra_dual, self)._repr_() + return super()._repr_() if self._scalar_name: return "Dual basis to %s" % self._dual_basis + " with respect to the " + self._scalar_name else: diff --git a/src/sage/combinat/sf/schur.py b/src/sage/combinat/sf/schur.py index daa9ef79f85..e132b753e11 100644 --- a/src/sage/combinat/sf/schur.py +++ b/src/sage/combinat/sf/schur.py @@ -185,7 +185,7 @@ def _element_constructor_(self, x): try: return self.skew_schur(x) except ValueError: - return super(SymmetricFunctionAlgebra_schur, self)._element_constructor_(x) + return super()._element_constructor_(x) def _repeated_bernstein_creation_operator_on_basis(self, la, nu): r""" diff --git a/src/sage/combinat/sf/sfa.py b/src/sage/combinat/sf/sfa.py index 853d5550a4a..d1fd77e8c69 100644 --- a/src/sage/combinat/sf/sfa.py +++ b/src/sage/combinat/sf/sfa.py @@ -2853,7 +2853,7 @@ def _latex_term(self, m): sage: latex(f) m_{1,1,1} + m_{2,1} + m_{3} """ - return super(SymmetricFunctionAlgebra_generic, self)._latex_term(','.join(str(i) for i in m)) + return super()._latex_term(','.join(str(i) for i in m)) def from_polynomial(self, poly, check=True): r""" diff --git a/src/sage/combinat/similarity_class_type.py b/src/sage/combinat/similarity_class_type.py index 8febf66ec03..234224eafd6 100644 --- a/src/sage/combinat/similarity_class_type.py +++ b/src/sage/combinat/similarity_class_type.py @@ -614,7 +614,7 @@ def __classcall_private__(cls, n, min=None): min = (min[0], Partition(min[1])) else: raise ValueError("min must be a PrimarySimilarityClassType") - return super(PrimarySimilarityClassTypes, cls).__classcall__(cls, n, min) + return super().__classcall__(cls, n, min) def __init__(self, n, min): r""" @@ -1027,7 +1027,7 @@ def __classcall_private__(cls, n, min=None): min = PrimarySimilarityClassType(min[0], min[1]) if not isinstance(min, PrimarySimilarityClassType): raise ValueError("min must be a PrimarySimilarityClassType") - return super(SimilarityClassTypes, cls).__classcall__(cls, n, min) + return super().__classcall__(cls, n, min) def __init__(self, n, min): r""" diff --git a/src/sage/combinat/six_vertex_model.py b/src/sage/combinat/six_vertex_model.py index 936a7e95b52..a3b28126923 100644 --- a/src/sage/combinat/six_vertex_model.py +++ b/src/sage/combinat/six_vertex_model.py @@ -8,6 +8,7 @@ from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets from sage.combinat.combinatorial_map import combinatorial_map + class SixVertexConfiguration(ClonableArray): """ A configuration in the six vertex model. @@ -451,7 +452,7 @@ def __classcall_private__(cls, n, m=None, boundary_conditions=None): boundary_conditions = ((False,)*m, (True,)*n)*2 else: boundary_conditions = tuple(tuple(x) for x in boundary_conditions) - return super(SixVertexModel, cls).__classcall__(cls, n, m, boundary_conditions) + return super().__classcall__(cls, n, m, boundary_conditions) def __init__(self, n, m, boundary_conditions): """ diff --git a/src/sage/combinat/skew_partition.py b/src/sage/combinat/skew_partition.py index eba4e0deecf..87ce705ae74 100644 --- a/src/sage/combinat/skew_partition.py +++ b/src/sage/combinat/skew_partition.py @@ -1576,6 +1576,7 @@ def __iter__(self): yield self.element_class(self, p) n += 1 + class SkewPartitions_n(SkewPartitions): """ The set of skew partitions of ``n`` with overlap at least @@ -1613,7 +1614,7 @@ def __classcall_private__(cls, n, overlap=0): """ if overlap == 'connected': overlap = 1 - return super(cls, SkewPartitions_n).__classcall__(cls, n, overlap) + return super().__classcall__(cls, n, overlap) def __init__(self, n, overlap): """ @@ -1824,7 +1825,7 @@ def __classcall_private__(cls, co, overlap=0): co = Compositions()(co) if overlap == 'connected': overlap = 1 - return super(SkewPartitions_rowlengths, cls).__classcall__(cls, co, overlap) + return super().__classcall__(cls, co, overlap) def __init__(self, co, overlap): """ diff --git a/src/sage/combinat/skew_tableau.py b/src/sage/combinat/skew_tableau.py index 532e3967ff0..170d7630f72 100644 --- a/src/sage/combinat/skew_tableau.py +++ b/src/sage/combinat/skew_tableau.py @@ -1989,7 +1989,7 @@ def __classcall_private__(cls, skp): sage: S is S2 True """ - return super(StandardSkewTableaux_shape, cls).__classcall__(cls, SkewPartition(skp)) + return super().__classcall__(cls, SkewPartition(skp)) def __init__(self, skp): """ @@ -2384,7 +2384,7 @@ def __classcall_private__(cls, n, mu): sage: S is S2 True """ - return super(SemistandardSkewTableaux_size_weight, cls).__classcall__(cls, n, tuple(mu)) + return super().__classcall__(cls, n, tuple(mu)) def __init__(self, n, mu): """ @@ -2464,7 +2464,7 @@ def __classcall_private__(cls, p, max_entry=None): """ if max_entry is None: max_entry = sum(p[0]) - sum(p[1]) - return super(SemistandardSkewTableaux_shape, cls).__classcall__(cls, SkewPartition(p), max_entry) + return super().__classcall__(cls, SkewPartition(p), max_entry) def __init__(self, p, max_entry): """ @@ -2543,7 +2543,7 @@ def __classcall_private__(cls, p, mu): """ p = SkewPartition(p) mu = tuple(mu) - return super(SemistandardSkewTableaux_shape_weight, cls).__classcall__(cls, p, mu) + return super().__classcall__(cls, p, mu) def __init__(self, p, mu): """ diff --git a/src/sage/combinat/subsets_pairwise.py b/src/sage/combinat/subsets_pairwise.py index aeceb704936..fc64df2e48f 100644 --- a/src/sage/combinat/subsets_pairwise.py +++ b/src/sage/combinat/subsets_pairwise.py @@ -79,14 +79,14 @@ class PairwiseCompatibleSubsets(RecursivelyEnumeratedSet_forest): lexicographic order. """ - #@staticmethod - #def __classcall__(cls, ambient, predicate): - # ambient = Set(ambient) - # return super(PairwiseCompatibleSubsets, cls).__classcall__(cls, ambient, predicate) + # @staticmethod + # def __classcall__(cls, ambient, predicate): + # ambient = Set(ambient) + # return super().__classcall__(cls, ambient, predicate) __len__ = None - def __init__(self, ambient, predicate, maximal = False, element_class = Set_object_enumerated): + def __init__(self, ambient, predicate, maximal=False, element_class=Set_object_enumerated): """ TESTS:: diff --git a/src/sage/combinat/subword_complex.py b/src/sage/combinat/subword_complex.py index 95d92c696cd..15af1d67ba0 100644 --- a/src/sage/combinat/subword_complex.py +++ b/src/sage/combinat/subword_complex.py @@ -1059,7 +1059,7 @@ def __classcall__(cls, Q, w, algorithm="inductive"): True """ Q = tuple(Q) - return super(SubwordComplex, cls).__classcall__(cls, Q, w, algorithm=algorithm) + return super().__classcall__(cls, Q, w, algorithm=algorithm) def __init__(self, Q, w, algorithm="inductive"): r""" diff --git a/src/sage/combinat/super_tableau.py b/src/sage/combinat/super_tableau.py index 07ab5e244b6..9be91778022 100644 --- a/src/sage/combinat/super_tableau.py +++ b/src/sage/combinat/super_tableau.py @@ -134,7 +134,7 @@ def __init__(self, parent, t, check=True, preprocessed=False): """ if not preprocessed: t = self._preprocess(t) - super(SemistandardSuperTableau, self).__init__(parent, t, check=check) + super().__init__(parent, t, check=check) @staticmethod def _preprocess(t): @@ -186,7 +186,7 @@ def check(self): ValueError: the entries of a semistandard super tableau must be non-negative primed integers """ - super(SemistandardSuperTableau, self).check() + super().check() for row in self: if not all(isinstance(c, PrimedEntry) and c > 0 for c in row): raise ValueError("the entries of a semistandard super tableau" @@ -299,7 +299,7 @@ def check(self): ValueError: the entries in each row of a semistandard super tableau must be weakly increasing """ - super(StandardSuperTableau, self).check() + super().check() # t is semistandard so we only need to check # that its entries are in bijection with {1',1,2', 2, ..., n} flattened_list = [i for row in self for i in row] @@ -737,8 +737,7 @@ def __init__(self, p): sage: TestSuite( StandardSuperTableaux([2,2,1]) ).run() """ - super(StandardSuperTableaux_shape, self).__init__( - category=FiniteEnumeratedSets()) + super().__init__(category=FiniteEnumeratedSets()) StandardSuperTableaux.__init__(self) self.shape = p diff --git a/src/sage/combinat/symmetric_group_algebra.py b/src/sage/combinat/symmetric_group_algebra.py index 603f4df9f3f..c3d67555a6b 100644 --- a/src/sage/combinat/symmetric_group_algebra.py +++ b/src/sage/combinat/symmetric_group_algebra.py @@ -368,7 +368,7 @@ def _coerce_map_from_(self, S): phi = S.to_symmetric_group_algebra return phi.codomain().canonical_embedding(self) * phi - return super(SymmetricGroupAlgebra_n, self)._coerce_map_from_(S) + return super()._coerce_map_from_(S) def _element_constructor_(self, x): """ @@ -392,7 +392,7 @@ def _element_constructor_(self, x): return self.monomial_from_smaller_permutation( from_permutation_group_element(x)) - return super(SymmetricGroupAlgebra_n, self)._element_constructor_(x) + return super()._element_constructor_(x) def _sibling(self, n): r""" @@ -757,7 +757,7 @@ def cell_module(self, la, **kwds): """ la = _Partitions(la) kwds['bracket'] = kwds.get('bracket', False) - return super(SymmetricGroupAlgebra_n, self).cell_module(la, **kwds) + return super().cell_module(la, **kwds) def retract_plain(self, f, m): r""" diff --git a/src/sage/combinat/tableau_residues.py b/src/sage/combinat/tableau_residues.py index 021865daaaa..9f2748fa70c 100644 --- a/src/sage/combinat/tableau_residues.py +++ b/src/sage/combinat/tableau_residues.py @@ -265,7 +265,7 @@ def __init__(self, parent, residues, check): sage: TestSuite( ResidueSequence(3, [0,0,1,2])).run(skip='_test_pickling') """ residues = tuple(parent._base_ring(i) for i in residues) - super(ResidueSequence, self).__init__(parent, residues, check) + super().__init__(parent, residues, check) def check(self): r""" @@ -727,7 +727,7 @@ def __init__(self, e, multicharge=(0,)): self._quantum_characteristic = e self._base_ring = IntegerModRing(self._quantum_characteristic) self._multicharge = tuple(self._base_ring(i) for i in multicharge) - super(ResidueSequences, self).__init__(category=Sets()) + super().__init__(category=Sets()) def _repr_(self): r""" diff --git a/src/sage/combinat/tuple.py b/src/sage/combinat/tuple.py index 9b773e0be70..7e7f85c61ef 100644 --- a/src/sage/combinat/tuple.py +++ b/src/sage/combinat/tuple.py @@ -63,7 +63,7 @@ def __classcall_private__(cls, S, k): sage: T = Tuples(['l','i','t'],2); T Tuples of ('l', 'i', 't') of length 2 """ - return super(Tuples, cls).__classcall__(cls, tuple(S), k) + return super().__classcall__(cls, tuple(S), k) def __init__(self, S, k): """ @@ -166,7 +166,7 @@ def __classcall_private__(cls, S, k): sage: T = UnorderedTuples(['l','i','t'],2); T Unordered tuples of ('l', 'i', 't') of length 2 """ - return super(UnorderedTuples, cls).__classcall__(cls, tuple(S), k) + return super().__classcall__(cls, tuple(S), k) def __init__(self, S, k): """ diff --git a/src/sage/combinat/vector_partition.py b/src/sage/combinat/vector_partition.py index 49c9c25c2e4..953e450d8a1 100644 --- a/src/sage/combinat/vector_partition.py +++ b/src/sage/combinat/vector_partition.py @@ -200,7 +200,7 @@ class VectorPartitions(UniqueRepresentation, Parent): [[2, 2]] """ @staticmethod - def __classcall_private__(cls, vec, min = None): + def __classcall_private__(cls, vec, min=None): r""" Create the class of vector partitions of ``vec`` where all parts are greater than or equal to the vector ``min``. @@ -213,10 +213,10 @@ def __classcall_private__(cls, vec, min = None): True """ if min is None: - min = find_min(vec)#tuple([0 for v in vec[:-1]]+[1]) + min = find_min(vec) # tuple([0 for v in vec[:-1]]+[1]) min = tuple(min) vec = tuple(vec) - return super(VectorPartitions, cls).__classcall__(cls, tuple(vec), min) + return super().__classcall__(cls, tuple(vec), min) def __init__(self, vec, min): r""" @@ -227,7 +227,7 @@ def __init__(self, vec, min): sage: VP = VectorPartitions([2, 2]) sage: TestSuite(VP).run() """ - Parent.__init__(self, category = FiniteEnumeratedSets()) + Parent.__init__(self, category=FiniteEnumeratedSets()) self._vec = vec self._min = min diff --git a/src/sage/combinat/words/word_generators.py b/src/sage/combinat/words/word_generators.py index 5cb363d248a..e7110609d63 100644 --- a/src/sage/combinat/words/word_generators.py +++ b/src/sage/combinat/words/word_generators.py @@ -222,13 +222,13 @@ def __init__(self, p, q, alphabet=(0,1), algorithm='cf'): w = u + v else: raise ValueError('Unknown algorithm (=%s)' % algorithm) - super(LowerChristoffelWord, self).__init__(FiniteWords(alphabet), w) + super().__init__(FiniteWords(alphabet), w) self.__p = p self.__q = q def markoff_number(self): r""" - Returns the Markoff number associated to the Christoffel word self. + Return the Markoff number associated to the Christoffel word ``self``. The *Markoff number* of a Christoffel word `w` is `trace(M(w))/3`, where `M(w)` is the `2\times 2` matrix obtained by applying the diff --git a/src/sage/combinat/yang_baxter_graph.py b/src/sage/combinat/yang_baxter_graph.py index 022ef775148..69fd04cbd04 100644 --- a/src/sage/combinat/yang_baxter_graph.py +++ b/src/sage/combinat/yang_baxter_graph.py @@ -586,7 +586,7 @@ def __init__(self, partition): root = sum([tuple(range(b)) for b in beta], tuple())[::-1] operators = [SwapIncreasingOperator(i) for i in range(sum(partition) - 1)] - super(YangBaxterGraph_partition, self).__init__(root, operators) + super().__init__(root, operators) def __repr__(self): r""" @@ -632,7 +632,7 @@ def _digraph(self): sage: Y.edges() [((0, 1, 0), (1, 0, 0), Swap positions 0 and 1)] """ - digraph = super(YangBaxterGraph_partition, self)._digraph + digraph = super()._digraph for (u, v, op) in digraph.edges(): digraph.set_edge_label(u, v, SwapOperator(op.position())) return digraph @@ -720,7 +720,7 @@ def vertex_relabelling_dict(self, v): (2, 0, 1, 0): (3, 4, 2, 1), (2, 1, 0, 0): (3, 2, 4, 1)} """ - return super(YangBaxterGraph_partition, self).vertex_relabelling_dict(v, self._swap_operator) + return super().vertex_relabelling_dict(v, self._swap_operator) def relabel_vertices(self, v, inplace=True): r"""