diff options
Diffstat (limited to 'sagemath-no-dict-sorting.patch')
-rw-r--r-- | sagemath-no-dict-sorting.patch | 5180 |
1 files changed, 52 insertions, 5128 deletions
diff --git a/sagemath-no-dict-sorting.patch b/sagemath-no-dict-sorting.patch index 367e671cbe07..7abeed0154bd 100644 --- a/sagemath-no-dict-sorting.patch +++ b/sagemath-no-dict-sorting.patch @@ -1,5138 +1,62 @@ -diff --git a/src/doc/en/prep/Advanced-2DPlotting.rst b/src/doc/en/prep/Advanced-2DPlotting.rst -index 337457afef..44fd5d0280 100644 ---- a/src/doc/en/prep/Advanced-2DPlotting.rst -+++ b/src/doc/en/prep/Advanced-2DPlotting.rst -@@ -430,17 +430,17 @@ Here are the options for contour plots. - :: - - sage: contour_plot.options -- {'aspect_ratio': 1, -- 'axes': False, -- 'colorbar': False, -- 'contours': None, -+ {'plot_points': 100, - 'fill': True, -- 'frame': True, -+ 'contours': None, -+ 'linewidths': None, -+ 'linestyles': None, - 'labels': False, -+ 'frame': True, -+ 'axes': False, -+ 'colorbar': False, - 'legend_label': None, -- 'linestyles': None, -- 'linewidths': None, -- 'plot_points': 100, -+ 'aspect_ratio': 1, - 'region': None} - - Let's change it so that all future contour plots don't have the fill. -@@ -451,17 +451,17 @@ the change happened. - - sage: contour_plot.options["fill"]=False - sage: contour_plot.options -- {'aspect_ratio': 1, -- 'axes': False, -- 'colorbar': False, -- 'contours': None, -+ {'plot_points': 100, - 'fill': False, -- 'frame': True, -+ 'contours': None, -+ 'linewidths': None, -+ 'linestyles': None, - 'labels': False, -+ 'frame': True, -+ 'axes': False, -+ 'colorbar': False, - 'legend_label': None, -- 'linestyles': None, -- 'linewidths': None, -- 'plot_points': 100, -+ 'aspect_ratio': 1, - 'region': None} - - And it works! -@@ -476,17 +476,17 @@ We can always access the default options, of course, to remind us. - :: - - sage: contour_plot.defaults() -- {'aspect_ratio': 1, -- 'axes': False, -- 'colorbar': False, -- 'contours': None, -+ {'plot_points': 100, - 'fill': True, -- 'frame': True, -+ 'contours': None, -+ 'linewidths': None, -+ 'linestyles': None, - 'labels': False, -+ 'frame': True, -+ 'axes': False, -+ 'colorbar': False, - 'legend_label': None, -- 'linestyles': None, -- 'linewidths': None, -- 'plot_points': 100, -+ 'aspect_ratio': 1, - 'region': None} - - .. _Vector: -diff --git a/src/doc/en/thematic_tutorials/lie/weyl_character_ring.rst b/src/doc/en/thematic_tutorials/lie/weyl_character_ring.rst -index a705250728..25a81f8fad 100644 ---- a/src/doc/en/thematic_tutorials/lie/weyl_character_ring.rst -+++ b/src/doc/en/thematic_tutorials/lie/weyl_character_ring.rst -@@ -419,7 +419,7 @@ coroot notation, you are working with `SL` automatically:: - - sage: A2 = WeylCharacterRing("A2", style="coroots") - sage: A2(1,0).weight_multiplicities() -- {(-1/3, -1/3, 2/3): 1, (-1/3, 2/3, -1/3): 1, (2/3, -1/3, -1/3): 1} -+ {(2/3, -1/3, -1/3): 1, (-1/3, 2/3, -1/3): 1, (-1/3, -1/3, 2/3): 1} - - There is no convenient way to create the determinant in the Weyl - character ring if you adopt the coroot style. -diff --git a/src/doc/en/thematic_tutorials/sandpile.rst b/src/doc/en/thematic_tutorials/sandpile.rst -index 7ee8f86d08..784096dc32 100644 ---- a/src/doc/en/thematic_tutorials/sandpile.rst -+++ b/src/doc/en/thematic_tutorials/sandpile.rst -@@ -731,7 +731,7 @@ Representatives of all divisor classes with nontrivial homology:: - - sage: p = S.betti_complexes() - sage: p[0] -- [{0: -8, 1: 5, 2: 4, 3: 1}, -+ [{1: 5, 2: 4, 3: 1, 0: -8}, - Simplicial complex with vertex set (1, 2, 3) and facets {(3,), (1, 2)}] - - The homology associated with the first divisor in the list:: -@@ -1141,7 +1141,8 @@ EXAMPLES:: - sage: S = Sandpile({0:{},1:{0: 1, 2: 1, 3: 4},2:{3: 5},3:{1: 1, 2: 1}},0) - sage: p = S.betti_complexes() - sage: p[0] -- [{0: -8, 1: 5, 2: 4, 3: 1}, Simplicial complex with vertex set (1, 2, 3) and facets {(3,), (1, 2)}] -+ [{1: 5, 2: 4, 3: 1, 0: -8}, -+ Simplicial complex with vertex set (1, 2, 3) and facets {(3,), (1, 2)}] - sage: S.resolution() - 'R^1 <-- R^5 <-- R^5 <-- R^1' - sage: S.betti() -@@ -1682,7 +1683,7 @@ equivalent modulo the rowspan of the Laplacian matrix:: - sage: s.group_order() - 28 - sage: s.jacobian_representatives() -- [{0: -5, 1: 3, 2: 2}, {0: -4, 1: 3, 2: 1}] -+ [{1: 3, 2: 2, 0: -5}, {1: 3, 2: 1, 0: -4}] - - Let `\tau` be the nonnegative generator of the kernel of the transpose of - the Laplacian, and let `tau_s` be it sink component, then the sandpile -@@ -2167,13 +2168,13 @@ EXAMPLES:: - - sage: S = Sandpile({0:[1], 2:[0,1], 1:[2]}) - sage: S.dict() -- {0: {1: 1}, 1: {2: 1}, 2: {0: 1, 1: 1}} -+ {0: {1: 1}, 2: {0: 1, 1: 1}, 1: {2: 1}} - sage: T = S.reorder_vertices() - - The vertices 1 and 2 have been swapped:: - - sage: T.dict() -- {0: {1: 1}, 1: {0: 1, 2: 1}, 2: {0: 1}} -+ {2: {0: 1}, 1: {2: 1, 0: 1}, 0: {1: 1}} - - --- - -@@ -4449,7 +4450,7 @@ EXAMPLES:: - sage: s = sandpiles.Complete(4) - sage: D = SandpileDivisor(s,[2,-3,2,0]) - sage: D.q_reduced() -- {0: -2, 1: 1, 2: 2, 3: 0} -+ {1: 1, 2: 2, 3: 0, 0: -2} - sage: D.q_reduced(False) - [-2, 1, 2, 0] - -diff --git a/src/doc/en/thematic_tutorials/tutorial-implementing-algebraic-structures.rst b/src/doc/en/thematic_tutorials/tutorial-implementing-algebraic-structures.rst -index d60a3dce09..8e48a5f2c1 100644 ---- a/src/doc/en/thematic_tutorials/tutorial-implementing-algebraic-structures.rst -+++ b/src/doc/en/thematic_tutorials/tutorial-implementing-algebraic-structures.rst -@@ -104,10 +104,10 @@ ask the category (TODO: find a slicker idiom for this):: - {'optional': ['_add_', '_mul_'], - 'required': ['__nonzero__', 'monomial_coefficients']} - sage: abstract_methods_of_class(AlgebrasWithBasis(QQ).element_class) # py3 -- {'optional': ['_add_', '_mul_'], -- 'required': ['__bool__', 'monomial_coefficients']} -+ {'required': ['__bool__', 'monomial_coefficients'], -+ 'optional': ['_add_', '_mul_']} - sage: abstract_methods_of_class(AlgebrasWithBasis(QQ).parent_class) -- {'optional': ['one_basis', 'product_on_basis'], 'required': ['__contains__']} -+ {'required': ['__contains__'], 'optional': ['one_basis', 'product_on_basis']} - - .. WARNING:: - -diff --git a/src/doc/en/thematic_tutorials/tutorial-objects-and-classes.rst b/src/doc/en/thematic_tutorials/tutorial-objects-and-classes.rst -index cbaff12746..aabab594f0 100644 ---- a/src/doc/en/thematic_tutorials/tutorial-objects-and-classes.rst -+++ b/src/doc/en/thematic_tutorials/tutorial-objects-and-classes.rst -@@ -230,7 +230,7 @@ combinatorial free module, the main attribute is called - indices:: - - sage: el._monomial_coefficients -- {[1, 2, 3]: 1, [1, 3, 2]: 3} -+ {[1, 3, 2]: 3, [1, 2, 3]: 1} - - Modifying the attribute modifies the objects:: - -@@ -298,7 +298,7 @@ http://docs.python.org/library/ for a complete list. :: - sage: el - bla - sage: el.__dict__ -- {'__custom_name': 'bla', 'value': 42} -+ {'value': 42, '__custom_name': 'bla'} - - Lots of Sage objects are not Python objects but compiled Cython - objects. Python sees them as builtin objects and you do not have -diff --git a/src/doc/en/thematic_tutorials/tutorial-programming-python.rst b/src/doc/en/thematic_tutorials/tutorial-programming-python.rst -index 51f31083bc..a4ef0bae04 100644 ---- a/src/doc/en/thematic_tutorials/tutorial-programming-python.rst -+++ b/src/doc/en/thematic_tutorials/tutorial-programming-python.rst -@@ -106,7 +106,7 @@ The *standard types* are :class:`bool`, :class:`int`, :class:`list`, - For example:: - - sage: age = {'toto' : 8, 'mom' : 27}; age -- {'mom': 27, 'toto': 8} -+ {'toto': 8, 'mom': 27} - - * Quotes (simple ``' '`` or double ``" "``) enclose *character - strings*. One can concatenate them using ``+``. -@@ -724,7 +724,7 @@ braces, ``{}``, with comma-separated entries given in the form - - sage: d = {3:17, 0.5:[4,1,5,2,3], 0:"goo", 3/2 : 17} - sage: d -- {0: 'goo', 0.500000000000000: [4, 1, 5, 2, 3], 3/2: 17, 3: 17} -+ {3: 17, 0.500000000000000: [4, 1, 5, 2, 3], 0: 'goo', 3/2: 17} - - A second method is to use the constructor :class:`dict` which admits a - list (or actually any iterable) of 2-tuples *(key, value)*:: -@@ -751,7 +751,7 @@ Dictionaries behave as lists and tuples for several important operations. - - sage: d[10]='a' - sage: d -- {0: 'goo', 0.500000000000000: [4, 1, 5, 2, 3], 3/2: 17, 3: 17, 10: 'a'} -+ {3: 17, 0.500000000000000: [4, 1, 5, 2, 3], 0: 'goo', 3/2: 17, 10: 'a'} - - A dictionary can have the same value multiple times, but each key must only - appear once and must be immutable:: -@@ -784,7 +784,7 @@ updates the dictionary from another dictionary:: - - sage: d.update({10 : 'newvalue', 20: 'newervalue', 3: 14, 0.5:[1,2,3]}) - sage: d -- {0.500000000000000: [1, 2, 3], 3: 14, 10: 'newvalue', 20: 'newervalue'} -+ {10: 'newvalue', 20: 'newervalue', 3: 14, 0.500000000000000: [1, 2, 3]} - - - We can iterate through the *keys*, or *values*, or both, of a -diff --git a/src/sage/algebras/cluster_algebra.py b/src/sage/algebras/cluster_algebra.py -index e3c7b1ea99..5ecea79c78 100644 ---- a/src/sage/algebras/cluster_algebra.py -+++ b/src/sage/algebras/cluster_algebra.py -@@ -183,7 +183,7 @@ g-vectors and F-polynomials can be computed from elements of ``A`` only if - sage: (t+s).is_homogeneous() - False - sage: (t+s).homogeneous_components() -- {(-1, 1): (x1 + y0)/x0, (0, -1): (x0*y1 + 1)/x1} -+ {(0, -1): (x0*y1 + 1)/x1, (-1, 1): (x1 + y0)/x0} - - Each cluster algebra is endowed with a reference to a current seed; - it could be useful to assign a name to it:: -@@ -557,7 +557,7 @@ class PrincipalClusterAlgebraElement(ClusterAlgebraElement): - sage: A = ClusterAlgebra(['B', 2], principal_coefficients=True) - sage: x = A.cluster_variable((1, 0)) + A.cluster_variable((0, 1)) - sage: x.homogeneous_components() -- {(0, 1): x1, (1, 0): x0} -+ {(1, 0): x0, (0, 1): x1} - """ - deg_matrix = block_matrix([[identity_matrix(self.parent().rank()), - -self.parent().b_matrix()]]) -diff --git a/src/sage/algebras/lie_algebras/lie_algebra_element.pyx b/src/sage/algebras/lie_algebras/lie_algebra_element.pyx -index d519d37b61..5ffc82d27f 100644 ---- a/src/sage/algebras/lie_algebras/lie_algebra_element.pyx -+++ b/src/sage/algebras/lie_algebras/lie_algebra_element.pyx -@@ -662,7 +662,7 @@ cdef class LieSubalgebraElementWrapper(LieAlgebraElementWrapper): - sage: b.monomial_coefficients() # We set b._monomial_coefficients - {0: 1, 1: 2} - sage: (a + b).monomial_coefficients() # This is now computed from a and b -- {0: 1, 1: 4, 2: 4} -+ {1: 4, 2: 4, 0: 1} - """ - cdef LieSubalgebraElementWrapper ret, other = <LieSubalgebraElementWrapper> right - ret = type(self)(self._parent, self.value + other.value) -@@ -688,7 +688,7 @@ cdef class LieSubalgebraElementWrapper(LieAlgebraElementWrapper): - sage: b.monomial_coefficients() # We set b._monomial_coefficients - {0: 1, 1: 2} - sage: (a - b).monomial_coefficients() # This is now computed from a and b -- {0: -1, 2: 4} -+ {2: 4, 0: -1} - """ - cdef LieSubalgebraElementWrapper ret, other = <LieSubalgebraElementWrapper> right - ret = type(self)(self._parent, self.value - other.value) -@@ -1046,9 +1046,7 @@ cdef class UntwistedAffineLieAlgebraElement(Element): - sage: L = lie_algebras.Affine(QQ, ['A',1,1]) - sage: x = L.an_element() - sage: x.t_dict() -- {-1: E[alpha[1]], -- 0: E[alpha[1]] + h1 + E[-alpha[1]], -- 1: E[-alpha[1]]} -+ {0: E[alpha[1]] + h1 + E[-alpha[1]], 1: E[-alpha[1]], -1: E[alpha[1]]} - """ - return self._t_dict.copy() - -diff --git a/src/sage/algebras/quantum_groups/representations.py b/src/sage/algebras/quantum_groups/representations.py -index e75cafc003..194eb7b1a3 100644 ---- a/src/sage/algebras/quantum_groups/representations.py -+++ b/src/sage/algebras/quantum_groups/representations.py -@@ -343,8 +343,7 @@ class AdjointRepresentation(CyclicRepresentation): - sage: R = ZZ['q'].fraction_field() - sage: V = AdjointRepresentation(R, K) - sage: V._zero_elts -- {0: [], 1: [[2], [-2]], 2: [[3], [-3]], -- 3: [[4], [-4]], 4: [[-4], [4]]} -+ {0: [], 4: [[-4], [4]], 3: [[4], [-4]], 2: [[3], [-3]], 1: [[2], [-2]]} - """ - C = self.basis().keys() - ret = {} -diff --git a/src/sage/algebras/weyl_algebra.py b/src/sage/algebras/weyl_algebra.py -index 67965111f6..6013e3b3c0 100644 ---- a/src/sage/algebras/weyl_algebra.py -+++ b/src/sage/algebras/weyl_algebra.py -@@ -583,7 +583,7 @@ class DifferentialWeylAlgebraElement(AlgebraElement): - sage: x - t^3*dt^3 + t^4*dt^2 + 9*t^2*dt^2 + 8*t^3*dt + 18*t*dt + 12*t^2 + 6 - sage: x.factor_differentials() -- {(0,): 12*t^2 + 6, (1,): 8*t^3 + 18*t, (2,): t^4 + 9*t^2, (3,): t^3} -+ {(3,): t^3, (2,): t^4 + 9*t^2, (1,): 8*t^3 + 18*t, (0,): 12*t^2 + 6} - sage: D.zero().factor_differentials() - {} - -@@ -595,17 +595,17 @@ class DifferentialWeylAlgebraElement(AlgebraElement): - x^3*dy^3 + x*y*z*dx*dy*dz + y^3*dx^3 + x^3*dx^3 - x*z*dx^3 + y*z*dy*dz - + x*z*dx*dz + x*y*dx*dy + 9*x^2*dx^2 + z*dz + y*dy + 19*x*dx + 7 - sage: elt.factor_differentials() -- {(0, 0, 0): 7, -- (0, 0, 1): z, -- (0, 1, 0): y, -+ {(0, 3, 0): x^3, -+ (1, 1, 1): x*y*z, -+ (3, 0, 0): x^3 + y^3 - x*z, - (0, 1, 1): y*z, -- (0, 3, 0): x^3, -- (1, 0, 0): 19*x, - (1, 0, 1): x*z, - (1, 1, 0): x*y, -- (1, 1, 1): x*y*z, - (2, 0, 0): 9*x^2, -- (3, 0, 0): x^3 + y^3 - x*z} -+ (0, 0, 1): z, -+ (0, 1, 0): y, -+ (1, 0, 0): 19*x, -+ (0, 0, 0): 7} - """ - ret = {} - DW = self.parent() -diff --git a/src/sage/categories/category.py b/src/sage/categories/category.py -index 4e8f58c84f..23d0879936 100644 ---- a/src/sage/categories/category.py -+++ b/src/sage/categories/category.py -@@ -1770,8 +1770,8 @@ class Category(UniqueRepresentation, SageObject): - {'element': {'optional': ['_add_', '_mul_'], 'required': ['__nonzero__']}, - 'parent': {'optional': ['algebra_generators'], 'required': ['__contains__']}} - sage: Algebras(QQ).required_methods() # py3 -- {'element': {'optional': ['_add_', '_mul_'], 'required': ['__bool__']}, -- 'parent': {'optional': ['algebra_generators'], 'required': ['__contains__']}} -+ {'parent': {'required': ['__contains__'], 'optional': ['algebra_generators']}, -+ 'element': {'required': ['__bool__'], 'optional': ['_add_', '_mul_']}} - """ - return { "parent" : abstract_methods_of_class(self.parent_class), - "element" : abstract_methods_of_class(self.element_class) } -diff --git a/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py b/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py -index edb8a5ffbc..fd842316c6 100644 ---- a/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py -+++ b/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py -@@ -86,12 +86,13 @@ class ComplexReflectionOrGeneralizedCoxeterGroups(Category_singleton): - [Category of finitely generated enumerated groups] - - sage: C.required_methods() -- {'element': {'optional': ['reflection_length'], -- 'required': []}, -- 'parent': {'optional': ['distinguished_reflection', 'hyperplane_index_set', -- 'irreducible_components', -- 'reflection', 'reflection_index_set'], -- 'required': ['__contains__', 'index_set']}} -+ {'parent': {'required': ['__contains__', 'index_set'], -+ 'optional': ['distinguished_reflection', -+ 'hyperplane_index_set', -+ 'irreducible_components', -+ 'reflection', -+ 'reflection_index_set']}, -+ 'element': {'required': [], 'optional': ['reflection_length']}} - - TESTS:: - -diff --git a/src/sage/categories/crystals.py b/src/sage/categories/crystals.py -index 7af4ec76da..cc8cb303f6 100644 ---- a/src/sage/categories/crystals.py -+++ b/src/sage/categories/crystals.py -@@ -74,7 +74,7 @@ class Crystals(Category_singleton): - - sage: from sage.misc.abstract_method import abstract_methods_of_class - sage: abstract_methods_of_class(Crystals().element_class) -- {'optional': [], 'required': ['e', 'epsilon', 'f', 'phi', 'weight']} -+ {'required': ['e', 'epsilon', 'f', 'phi', 'weight'], 'optional': []} - - TESTS:: - -diff --git a/src/sage/categories/finite_dimensional_algebras_with_basis.py b/src/sage/categories/finite_dimensional_algebras_with_basis.py -index 754d26276e..ec51907106 100644 ---- a/src/sage/categories/finite_dimensional_algebras_with_basis.py -+++ b/src/sage/categories/finite_dimensional_algebras_with_basis.py -@@ -1276,9 +1276,9 @@ class FiniteDimensionalAlgebrasWithBasis(CategoryWithAxiom_over_base_ring): - - sage: S = SymmetricGroupAlgebra(QQ, 3) - sage: dict(S.cells()) -- {[1, 1, 1]: Standard tableaux of shape [1, 1, 1], -+ {[3]: Standard tableaux of shape [3], - [2, 1]: Standard tableaux of shape [2, 1], -- [3]: Standard tableaux of shape [3]} -+ [1, 1, 1]: Standard tableaux of shape [1, 1, 1]} - """ - from sage.sets.family import Family - return Family(self.cell_poset(), self.cell_module_indices) -diff --git a/src/sage/categories/map.pyx b/src/sage/categories/map.pyx -index 91598d3cd4..5d04074012 100644 ---- a/src/sage/categories/map.pyx -+++ b/src/sage/categories/map.pyx -@@ -444,8 +444,8 @@ cdef class Map(Element): - sage: from sage.categories.map import Map - sage: f = Map(Hom(QQ, ZZ, Rings())) - sage: f._extra_slots_test() -- {'_codomain': Integer Ring, -- '_domain': Rational Field, -+ {'_domain': Rational Field, -+ '_codomain': Integer Ring, - '_is_coercion': False, - '_repr_type_str': None} - """ -diff --git a/src/sage/categories/morphism.pyx b/src/sage/categories/morphism.pyx -index dec8b00b74..9322833836 100644 ---- a/src/sage/categories/morphism.pyx -+++ b/src/sage/categories/morphism.pyx -@@ -601,11 +601,11 @@ cdef class SetMorphism(Morphism): - - sage: f = sage.categories.morphism.SetMorphism(Hom(ZZ,ZZ, Sets()), operator.__abs__) - sage: f._extra_slots_test() -- {'_codomain': Integer Ring, -- '_domain': Integer Ring, -- '_function': <built-in function ...abs...>, -+ {'_domain': Integer Ring, -+ '_codomain': Integer Ring, - '_is_coercion': False, -- '_repr_type_str': None} -+ '_repr_type_str': None, -+ '_function': <built-in function abs>} - """ - slots = Map._extra_slots(self) - slots['_function'] = self._function -diff --git a/src/sage/categories/primer.py b/src/sage/categories/primer.py -index 74b17110f0..a5b3e55988 100644 ---- a/src/sage/categories/primer.py -+++ b/src/sage/categories/primer.py -@@ -764,8 +764,8 @@ operations. In particular a list of mandatory and optional methods to - be implemented can be found by introspection with:: - - sage: Groups().required_methods() -- {'element': {'optional': ['_mul_'], 'required': []}, -- 'parent': {'optional': [], 'required': ['__contains__']}} -+ {'parent': {'required': ['__contains__'], 'optional': []}, -+ 'element': {'required': [], 'optional': ['_mul_']}} - - Documentation about those methods can be obtained with:: - -@@ -985,9 +985,9 @@ A (not yet complete) list of mandatory and optional methods to be - implemented can be found by introspection with:: - - sage: FiniteSemigroups().required_methods() -- {'element': {'optional': ['_mul_'], 'required': []}, -- 'parent': {'optional': ['semigroup_generators'], -- 'required': ['__contains__']}} -+ {'parent': {'required': ['__contains__'], -+ 'optional': ['semigroup_generators']}, -+ 'element': {'required': [], 'optional': ['_mul_']}} - - ``product`` does not appear in the list because a default implementation - is provided in term of the method ``_mul_`` on elements. Of course, at -diff --git a/src/sage/categories/pushout.py b/src/sage/categories/pushout.py -index d3280aad2c..29f0d3672e 100644 ---- a/src/sage/categories/pushout.py -+++ b/src/sage/categories/pushout.py -@@ -2385,7 +2385,7 @@ class CompletionFunctor(ConstructionFunctor): - sage: F2 - Completion[+Infinity, prec=53] - sage: F2.extras -- {'rnd': 0, 'sci_not': False, 'type': 'MPFR'} -+ {'type': 'MPFR', 'sci_not': False, 'rnd': 0} - """ - Functor.__init__(self, Rings(), Rings()) - self.p = p -diff --git a/src/sage/categories/regular_supercrystals.py b/src/sage/categories/regular_supercrystals.py -index a4cc095f51..5a4e347611 100644 ---- a/src/sage/categories/regular_supercrystals.py -+++ b/src/sage/categories/regular_supercrystals.py -@@ -55,7 +55,7 @@ class RegularSuperCrystals(Category_singleton): - sage: from sage.misc.abstract_method import abstract_methods_of_class - sage: from sage.categories.regular_supercrystals import RegularSuperCrystals - sage: abstract_methods_of_class(RegularSuperCrystals().element_class) -- {'optional': [], 'required': ['e', 'f', 'weight']} -+ {'required': ['e', 'f', 'weight'], 'optional': []} - - TESTS:: - -diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py -index 4b8f04dc4e..a5b1a59636 100644 ---- a/src/sage/coding/linear_code.py -+++ b/src/sage/coding/linear_code.py -@@ -2676,22 +2676,22 @@ class LinearCodeSyndromeDecoder(Decoder): - sage: D = codes.decoders.LinearCodeSyndromeDecoder(C, maximum_error_weight = 1) - sage: D._build_lookup_table() - {(0, 0, 0, 0): (0, 0, 0, 0, 0, 0, 0, 0), -- (0, 0, 0, 1): (0, 0, 0, 0, 1, 0, 0, 0), -- (0, 0, 0, 2): (0, 0, 0, 0, 2, 0, 0, 0), -- (0, 0, 1, 0): (0, 0, 1, 0, 0, 0, 0, 0), -- (0, 0, 1, 2): (0, 0, 0, 0, 0, 0, 0, 1), -- (0, 0, 2, 0): (0, 0, 2, 0, 0, 0, 0, 0), -- (0, 0, 2, 1): (0, 0, 0, 0, 0, 0, 0, 2), -+ (1, 0, 0, 0): (1, 0, 0, 0, 0, 0, 0, 0), -+ (2, 0, 0, 0): (2, 0, 0, 0, 0, 0, 0, 0), - (0, 1, 0, 0): (0, 1, 0, 0, 0, 0, 0, 0), -- (0, 1, 1, 2): (0, 0, 0, 0, 0, 0, 2, 0), - (0, 2, 0, 0): (0, 2, 0, 0, 0, 0, 0, 0), -- (0, 2, 2, 1): (0, 0, 0, 0, 0, 0, 1, 0), -- (1, 0, 0, 0): (1, 0, 0, 0, 0, 0, 0, 0), -- (1, 2, 0, 2): (0, 0, 0, 0, 0, 1, 0, 0), -+ (0, 0, 1, 0): (0, 0, 1, 0, 0, 0, 0, 0), -+ (0, 0, 2, 0): (0, 0, 2, 0, 0, 0, 0, 0), - (1, 2, 2, 0): (0, 0, 0, 1, 0, 0, 0, 0), -- (2, 0, 0, 0): (2, 0, 0, 0, 0, 0, 0, 0), -+ (2, 1, 1, 0): (0, 0, 0, 2, 0, 0, 0, 0), -+ (0, 0, 0, 1): (0, 0, 0, 0, 1, 0, 0, 0), -+ (0, 0, 0, 2): (0, 0, 0, 0, 2, 0, 0, 0), -+ (1, 2, 0, 2): (0, 0, 0, 0, 0, 1, 0, 0), - (2, 1, 0, 1): (0, 0, 0, 0, 0, 2, 0, 0), -- (2, 1, 1, 0): (0, 0, 0, 2, 0, 0, 0, 0)} -+ (0, 2, 2, 1): (0, 0, 0, 0, 0, 0, 1, 0), -+ (0, 1, 1, 2): (0, 0, 0, 0, 0, 0, 2, 0), -+ (0, 0, 1, 2): (0, 0, 0, 0, 0, 0, 0, 1), -+ (0, 0, 2, 1): (0, 0, 0, 0, 0, 0, 0, 2)} - - TESTS: - -@@ -2705,11 +2705,11 @@ class LinearCodeSyndromeDecoder(Decoder): - sage: D = codes.decoders.LinearCodeSyndromeDecoder(C) - sage: D.syndrome_table() - {(0, 0): (0, 0, 0), -- (0, 1): (0, 1, 0), -- (0, 2): (0, 2, 0), -- (0, a): (0, a, 0), -+ (1, 0): (1, 0, 0), -+ (2, 0): (2, 0, 0), -+ (a, 0): (a, 0, 0), - ... -- (2*a + 2, 2*a): (0, 0, 2), -+ (2*a + 2, a + 2): (2*a + 2, a + 2, 0), - (2*a + 2, 2*a + 1): (2*a + 2, 2*a + 1, 0), - (2*a + 2, 2*a + 2): (2*a + 2, 2*a + 2, 0)} - """ -diff --git a/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py b/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py -index beee549e25..fe272de2a3 100644 ---- a/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py -+++ b/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py -@@ -2733,119 +2733,119 @@ class ClusterSeed(SageObject): - sage: B = [[0, 4, 0, -1],[-4,0, 3, 0],[0, -3, 0, 1],[1, 0, -1, 0]] - sage: S = ClusterSeed(matrix(B)); S.mutate([2,3,1,2,1,3,0,2]) - sage: S.mutation_analysis() -- {0: {'d_matrix': [ 0 0 1 0] -- [ 0 -1 0 0] -- [ 0 0 0 -1] -- [-1 0 0 0], -- 'denominators': [1, 1, x0, 1], -+ {0: {'edges': 13, - 'edge_diff': 6, -- 'edges': 13, - 'green_vertices': [0, 1, 3], - 'green_vertices_diff': {'added': [0], 'removed': []}, - 'red_vertices': [2], - 'red_vertices_diff': {'added': [], 'removed': [0]}, -- 'sinks': [], -- 'sinks_diff': {'added': [], 'removed': [2]}, -+ 'urban_renewals': [], -+ 'urban_renewals_diff': {'added': [], 'removed': []}, - 'sources': [], - 'sources_diff': {'added': [], 'removed': []}, -- 'urban_renewals': [], -- 'urban_renewals_diff': {'added': [], 'removed': []}}, -- 1: {'d_matrix': [ 1 4 1 0] -- [ 0 1 0 0] -+ 'sinks': [], -+ 'sinks_diff': {'added': [], 'removed': [2]}, -+ 'denominators': [1, 1, x0, 1], -+ 'd_matrix': [ 0 0 1 0] -+ [ 0 -1 0 0] - [ 0 0 0 -1] -- [ 1 4 0 0], -- 'denominators': [x0*x3, x0^4*x1*x3^4, x0, 1], -+ [-1 0 0 0]}, -+ 1: {'edges': 9, - 'edge_diff': 2, -- 'edges': 9, - 'green_vertices': [0, 3], - 'green_vertices_diff': {'added': [0], 'removed': [1]}, - 'red_vertices': [1, 2], - 'red_vertices_diff': {'added': [1], 'removed': [0]}, -- 'sinks': [2], -- 'sinks_diff': {'added': [], 'removed': []}, -+ 'urban_renewals': [], -+ 'urban_renewals_diff': {'added': [], 'removed': []}, - 'sources': [], - 'sources_diff': {'added': [], 'removed': []}, -- 'urban_renewals': [], -- 'urban_renewals_diff': {'added': [], 'removed': []}}, -- 2: {'d_matrix': [ 1 0 0 0] -- [ 0 -1 0 0] -+ 'sinks': [2], -+ 'sinks_diff': {'added': [], 'removed': []}, -+ 'denominators': [x0*x3, x0^4*x1*x3^4, x0, 1], -+ 'd_matrix': [ 1 4 1 0] -+ [ 0 1 0 0] - [ 0 0 0 -1] -- [ 1 0 1 0], -- 'denominators': [x0*x3, 1, x3, 1], -+ [ 1 4 0 0]}, -+ 2: {'edges': 7, - 'edge_diff': 0, -- 'edges': 7, - 'green_vertices': [1, 2, 3], - 'green_vertices_diff': {'added': [2], 'removed': []}, - 'red_vertices': [0], - 'red_vertices_diff': {'added': [], 'removed': [2]}, -- 'sinks': [], -- 'sinks_diff': {'added': [], 'removed': [2]}, -+ 'urban_renewals': [], -+ 'urban_renewals_diff': {'added': [], 'removed': []}, - 'sources': [2], - 'sources_diff': {'added': [2], 'removed': []}, -- 'urban_renewals': [], -- 'urban_renewals_diff': {'added': [], 'removed': []}}, -- 3: {'d_matrix': [ 1 0 1 1] -+ 'sinks': [], -+ 'sinks_diff': {'added': [], 'removed': [2]}, -+ 'denominators': [x0*x3, 1, x3, 1], -+ 'd_matrix': [ 1 0 0 0] - [ 0 -1 0 0] -- [ 0 0 0 1] -- [ 1 0 0 1], -- 'denominators': [x0*x3, 1, x0, x0*x2*x3], -+ [ 0 0 0 -1] -+ [ 1 0 1 0]}, -+ 3: {'edges': 6, - 'edge_diff': -1, -- 'edges': 6, - 'green_vertices': [1], - 'green_vertices_diff': {'added': [], 'removed': [3]}, - 'red_vertices': [0, 2, 3], - 'red_vertices_diff': {'added': [3], 'removed': []}, -- 'sinks': [2], -- 'sinks_diff': {'added': [], 'removed': []}, -+ 'urban_renewals': [], -+ 'urban_renewals_diff': {'added': [], 'removed': []}, - 'sources': [1], - 'sources_diff': {'added': [1], 'removed': []}, -- 'urban_renewals': [], -- 'urban_renewals_diff': {'added': [], 'removed': []}}} -+ 'sinks': [2], -+ 'sinks_diff': {'added': [], 'removed': []}, -+ 'denominators': [x0*x3, 1, x0, x0*x2*x3], -+ 'd_matrix': [ 1 0 1 1] -+ [ 0 -1 0 0] -+ [ 0 0 0 1] -+ [ 1 0 0 1]}} - - sage: S = ClusterSeed(['A',3]).principal_extension() - sage: S.mutation_analysis() -- {0: {'d_matrix': [ 1 0 0] -- [ 0 -1 0] -- [ 0 0 -1], -- 'denominators': [x0, 1, 1], -- 'green_vertices': [1, 2], -+ {0: {'green_vertices': [1, 2], - 'green_vertices_diff': {'added': [], 'removed': [0]}, - 'red_vertices': [0], - 'red_vertices_diff': {'added': [0], 'removed': []}, -- 'sinks': [], -- 'sinks_diff': {'added': [], 'removed': [1]}, -+ 'urban_renewals': [], -+ 'urban_renewals_diff': {'added': [], 'removed': []}, - 'sources': [4, 5], - 'sources_diff': {'added': [], 'removed': [3]}, -- 'urban_renewals': [], -- 'urban_renewals_diff': {'added': [], 'removed': []}}, -- 1: {'d_matrix': [-1 0 0] -- [ 0 1 0] -- [ 0 0 -1], -- 'denominators': [1, x1, 1], -- 'green_vertices': [0, 2], -+ 'sinks': [], -+ 'sinks_diff': {'added': [], 'removed': [1]}, -+ 'denominators': [x0, 1, 1], -+ 'd_matrix': [ 1 0 0] -+ [ 0 -1 0] -+ [ 0 0 -1]}, -+ 1: {'green_vertices': [0, 2], - 'green_vertices_diff': {'added': [], 'removed': [1]}, - 'red_vertices': [1], - 'red_vertices_diff': {'added': [1], 'removed': []}, -- 'sinks': [0, 2, 4], -- 'sinks_diff': {'added': [0, 2, 4], 'removed': [1]}, -+ 'urban_renewals': [], -+ 'urban_renewals_diff': {'added': [], 'removed': []}, - 'sources': [1, 3, 5], - 'sources_diff': {'added': [1], 'removed': [4]}, -- 'urban_renewals': [], -- 'urban_renewals_diff': {'added': [], 'removed': []}}, -- 2: {'d_matrix': [-1 0 0] -- [ 0 -1 0] -- [ 0 0 1], -- 'denominators': [1, 1, x2], -- 'green_vertices': [0, 1], -+ 'sinks': [0, 2, 4], -+ 'sinks_diff': {'added': [0, 2, 4], 'removed': [1]}, -+ 'denominators': [1, x1, 1], -+ 'd_matrix': [-1 0 0] -+ [ 0 1 0] -+ [ 0 0 -1]}, -+ 2: {'green_vertices': [0, 1], - 'green_vertices_diff': {'added': [], 'removed': [2]}, - 'red_vertices': [2], - 'red_vertices_diff': {'added': [2], 'removed': []}, -- 'sinks': [], -- 'sinks_diff': {'added': [], 'removed': [1]}, -+ 'urban_renewals': [], -+ 'urban_renewals_diff': {'added': [], 'removed': []}, - 'sources': [3, 4], - 'sources_diff': {'added': [], 'removed': [5]}, -- 'urban_renewals': [], -- 'urban_renewals_diff': {'added': [], 'removed': []}}} -+ 'sinks': [], -+ 'sinks_diff': {'added': [], 'removed': [1]}, -+ 'denominators': [1, 1, x2], -+ 'd_matrix': [-1 0 0] -+ [ 0 -1 0] -+ [ 0 0 1]}} - - """ - -diff --git a/src/sage/combinat/crystals/kirillov_reshetikhin.py b/src/sage/combinat/crystals/kirillov_reshetikhin.py -index 28b76b6f9c..0b0eb4404b 100644 ---- a/src/sage/combinat/crystals/kirillov_reshetikhin.py -+++ b/src/sage/combinat/crystals/kirillov_reshetikhin.py -@@ -1187,11 +1187,11 @@ class KR_type_E6(KirillovReshetikhinCrystalFromPromotion): - - sage: K = crystals.KirillovReshetikhin(['E',6,1],2,1) - sage: K.highest_weight_dict_inv() -- {((-2, 0, 1, 0, 0, 0, 0), 1): [[(2, -1), (1,)]], -+ {((0, 0, 0, 0, 0, 0, 0), 0): [], -+ ((-2, 0, 1, 0, 0, 0, 0), 1): [[(2, -1), (1,)]], - ((-1, -1, 0, 0, 0, 1, 0), 1): [[(5, -3), (-1, 3)]], -- ((0, -2, 0, 1, 0, 0, 0), 1): [[(-1,), (-1, 3)]], -- ((0, 0, 0, 0, 0, 0, 0), 0): [], -- ((0, 0, 0, 0, 0, 0, 0), 1): [[(1, -3), (-1, 3)]]} -+ ((0, 0, 0, 0, 0, 0, 0), 1): [[(1, -3), (-1, 3)]], -+ ((0, -2, 0, 1, 0, 0, 0), 1): [[(-1,), (-1, 3)]]} - """ - hw = [x for x in self.hw_auxiliary() if x.epsilon(6) == 0] - dic = {(self.affine_weight(x), len(x)): x for x in hw} -@@ -1943,8 +1943,8 @@ class KR_type_box(KirillovReshetikhinGenericCrystal, AffineCrystalFromClassical) - sage: K.highest_weight_dict() - {[]: [], - [2]: [[1]], -- [2, 2]: [[1], [2]], - [4]: [[1, 1]], -+ [2, 2]: [[1], [2]], - [4, 2]: [[1, 1], [2]], - [4, 4]: [[1, 1], [2, 2]]} - """ -@@ -1963,8 +1963,8 @@ class KR_type_box(KirillovReshetikhinGenericCrystal, AffineCrystalFromClassical) - sage: K.ambient_highest_weight_dict() - {[]: [], - [2]: [[1, 1]], -- [2, 2]: [[1, 1], [2, 2]], - [4]: [[1, 1, 1, 1]], -+ [2, 2]: [[1, 1], [2, 2]], - [4, 2]: [[1, 1, 1, 1], [2, 2]], - [4, 4]: [[1, 1, 1, 1], [2, 2, 2, 2]]} - """ -diff --git a/src/sage/combinat/crystals/mv_polytopes.py b/src/sage/combinat/crystals/mv_polytopes.py -index 25fdd16c3f..d22d1acccc 100644 ---- a/src/sage/combinat/crystals/mv_polytopes.py -+++ b/src/sage/combinat/crystals/mv_polytopes.py -@@ -452,10 +452,10 @@ class MVPolytopes(PBWCrystal): - - sage: MV = crystals.infinity.MVPolytopes(['F', 4]) - sage: MV.latex_options() -- {'P': Ambient space of the Root system of type ['F', 4], -- 'circle_size': 0.1, -+ {'projection': True, - 'mark_endpoints': True, -- 'projection': True} -+ 'P': Ambient space of the Root system of type ['F', 4], -+ 'circle_size': 0.1} - """ - from copy import copy - return copy(self._latex_options) -diff --git a/src/sage/combinat/dyck_word.py b/src/sage/combinat/dyck_word.py -index a87cc7b200..cf770c70cd 100644 ---- a/src/sage/combinat/dyck_word.py -+++ b/src/sage/combinat/dyck_word.py -@@ -430,12 +430,12 @@ class DyckWord(CombinatorialElement): - - sage: D = DyckWord([1,0,1,0,1,0]) - sage: D.latex_options() -- {'bounce path': False, -- 'color': black, -+ {'tikz_scale': 1, - 'diagonal': False, - 'line width': 2, -+ 'color': black, -+ 'bounce path': False, - 'peaks': False, -- 'tikz_scale': 1, - 'valleys': False} - - .. TODO:: -diff --git a/src/sage/combinat/finite_state_machine.py b/src/sage/combinat/finite_state_machine.py -index a5d5421b07..acfe59bcac 100644 ---- a/src/sage/combinat/finite_state_machine.py -+++ b/src/sage/combinat/finite_state_machine.py -@@ -2130,8 +2130,7 @@ class FSMState(SageObject): - sage: A.state(0)._in_epsilon_cycle_(A) - True - sage: A.state(4)._epsilon_successors_(A) -- {0: [['d', 'b', 'c']], 1: [['d'], ['d', 'b', 'c', 'a']], -- 2: [['d', 'b']]} -+ {1: [['d'], ['d', 'b', 'c', 'a']], 2: [['d', 'b']], 0: [['d', 'b', 'c']]} - sage: A.state(4)._in_epsilon_cycle_(A) - False - """ -@@ -7218,7 +7217,7 @@ class FiniteStateMachine(SageObject): - sage: S.epsilon_successors(0) - {0: [['a', 'b']], 1: [['a']]} - sage: S.epsilon_successors(1) -- {0: [['b']], 1: [['b', 'a']]} -+ {1: [['b', 'a']], 0: [['b']]} - """ - return self.state(state)._epsilon_successors_(self) - -@@ -15050,7 +15049,7 @@ class _FSMProcessIteratorEpsilon_(FSMProcessIterator): - This class has the additional attribute ``visited_states``:: - - sage: it.visited_states -- {0: [''], 1: ['bc'], 2: ['b']} -+ {0: [''], 2: ['b'], 1: ['bc']} - - This means the following (let us skip the state `0` for a moment): - State `1` can be reached by a epsilon path which write ``'bc'`` as -@@ -15077,7 +15076,7 @@ class _FSMProcessIteratorEpsilon_(FSMProcessIterator): - +-- tape at 0, [['c']] - process (0 branches) - sage: it.visited_states -- {1: ['c'], 2: ['']} -+ {2: [''], 1: ['c']} - - TESTS:: - -@@ -15105,7 +15104,7 @@ class _FSMProcessIteratorEpsilon_(FSMProcessIterator): - +-- tape at 0, [[]] - process (0 branches) - sage: it.visited_states -- {1: [[], []], 2: [[]], 3: [[]], 4: [[], []]} -+ {1: [[], []], 2: [[]], 4: [[], []], 3: [[]]} - - At this point note that in the previous output, state `1` (from - which we started) was also reached by a non-trivial -@@ -15129,7 +15128,7 @@ class _FSMProcessIteratorEpsilon_(FSMProcessIterator): - +-- tape at 0, [[]] - process (0 branches) - sage: it.visited_states -- {1: [[]], 2: [[], []], 3: [[]], 4: [[], []]} -+ {2: [[], []], 3: [[]], 1: [[]], 4: [[], []]} - sage: it = _FSMProcessIteratorEpsilon_(A, initial_state=A.state(3)) - sage: for current in it: - ....: print(current) -@@ -15145,7 +15144,7 @@ class _FSMProcessIteratorEpsilon_(FSMProcessIterator): - +-- tape at 0, [[]] - process (0 branches) - sage: it.visited_states -- {1: [[]], 2: [[]], 3: [[], []], 4: [[], []]} -+ {3: [[], []], 1: [[]], 4: [[], []], 2: [[]]} - sage: it = _FSMProcessIteratorEpsilon_(A, initial_state=A.state(4)) - sage: for current in it: - ....: print(current) -@@ -15182,8 +15181,7 @@ class _FSMProcessIteratorEpsilon_(FSMProcessIterator): - +-- tape at 0, [['b', 'c', 'e']] - process (0 branches) - sage: it.visited_states -- {1: ['', 'bcd'], 2: ['b'], -- 3: ['bc'], 4: ['f', 'bce']} -+ {1: ['', 'bcd'], 2: ['b'], 4: ['f', 'bce'], 3: ['bc']} - sage: it = _FSMProcessIteratorEpsilon_(T, initial_state=T.state(2), - ....: format_output=lambda o: ''.join(o)) - sage: for current in it: -@@ -15201,8 +15199,7 @@ class _FSMProcessIteratorEpsilon_(FSMProcessIterator): - +-- tape at 0, [['c', 'd', 'f']] - process (0 branches) - sage: it.visited_states -- {1: ['cd'], 2: ['', 'cdb'], -- 3: ['c'], 4: ['ce', 'cdf']} -+ {2: ['', 'cdb'], 3: ['c'], 1: ['cd'], 4: ['ce', 'cdf']} - sage: it = _FSMProcessIteratorEpsilon_(T, initial_state=T.state(3), - ....: format_output=lambda o: ''.join(o)) - sage: for current in it: -@@ -15219,8 +15216,7 @@ class _FSMProcessIteratorEpsilon_(FSMProcessIterator): - +-- tape at 0, [['d', 'f']] - process (0 branches) - sage: it.visited_states -- {1: ['d'], 2: ['db'], -- 3: ['', 'dbc'], 4: ['e', 'df']} -+ {3: ['', 'dbc'], 1: ['d'], 4: ['e', 'df'], 2: ['db']} - sage: it = _FSMProcessIteratorEpsilon_(T, initial_state=T.state(4), - ....: format_output=lambda o: ''.join(o)) - sage: for current in it: -@@ -15367,9 +15363,9 @@ class _FSMProcessIteratorEpsilon_(FSMProcessIterator): - sage: T.state(0)._epsilon_successors_(T) # indirect doctest - {0: [['a', 'b', 'c']], 1: [['a']], 2: [['a', 'b']]} - sage: T.state(1)._epsilon_successors_(T) # indirect doctest -- {0: [['b', 'c']], 1: [['b', 'c', 'a']], 2: [['b']]} -+ {1: [['b', 'c', 'a']], 2: [['b']], 0: [['b', 'c']]} - sage: T.state(2)._epsilon_successors_(T) # indirect doctest -- {0: [['c']], 1: [['c', 'a']], 2: [['c', 'a', 'b']]} -+ {2: [['c', 'a', 'b']], 0: [['c']], 1: [['c', 'a']]} - """ - if state not in self.visited_states: - self.visited_states[state] = [] -diff --git a/src/sage/combinat/growth.py b/src/sage/combinat/growth.py -index d26bf37e0b..506de7355d 100644 ---- a/src/sage/combinat/growth.py -+++ b/src/sage/combinat/growth.py -@@ -704,7 +704,7 @@ class GrowthDiagram(SageObject): - sage: RuleRSK = GrowthDiagram.rules.RSK() - sage: G = GrowthDiagram(RuleRSK, [[0,1,0], [1,0,2]]) - sage: G.filling() -- {(0, 1): 1, (1, 0): 1, (2, 1): 2} -+ {(1, 0): 1, (0, 1): 1, (2, 1): 2} - """ - return self._filling - -@@ -1359,7 +1359,7 @@ class GrowthDiagram(SageObject): - - sage: G = GrowthDiagram(RuleRSK, pi.to_matrix()) # indirect doctest - sage: G._filling -- {(0, 1): 1, (1, 2): 1, (2, 0): 1, (3, 5): 1, (4, 3): 1, (5, 4): 1} -+ {(2, 0): 1, (0, 1): 1, (1, 2): 1, (4, 3): 1, (5, 4): 1, (3, 5): 1} - sage: G.shape() - [6, 6, 6, 6, 6, 6] / [] - -@@ -1383,7 +1383,7 @@ class GrowthDiagram(SageObject): - - sage: G = GrowthDiagram(RuleRSK, [[1,0,1],[0,1]]) # indirect doctest - sage: G._filling -- {(0, 0): 1, (1, 1): 1, (2, 0): 1} -+ {(0, 0): 1, (2, 0): 1, (1, 1): 1} - sage: G.shape() - [3, 2] / [] - -@@ -1391,7 +1391,7 @@ class GrowthDiagram(SageObject): - - sage: G = GrowthDiagram(RuleRSK, [[1,0,1],[0,1]], shape=SkewPartition([[3,2],[1]])) # indirect doctest - sage: G._filling -- {(0, 0): 1, (1, 1): 1, (2, 0): 1} -+ {(0, 0): 1, (2, 0): 1, (1, 1): 1} - sage: G.shape() - [3, 2] / [1] - -@@ -1538,14 +1538,14 @@ class GrowthDiagram(SageObject): - sage: labels = [[], [1], [2], [2,1], [1,1], [1], []] - sage: G = GrowthDiagram(RuleRSK, labels=labels) # indirect doctest - sage: G._filling -- {(0, 1): 1, (1, 2): 1, (2, 0): 1} -+ {(1, 2): 1, (0, 1): 1, (2, 0): 1} - sage: G._in_labels - [[], [], [], [], [], [], []] - - sage: labels = [[], [1], [2], [3], [3, 1], [3, 2], [4, 2], [4, 1], [3, 1], [2, 1], [1, 1], [1], []] - sage: G = GrowthDiagram(RuleRSK, labels=labels) # indirect doctest - sage: G._filling -- {(0, 1): 1, (1, 2): 1, (2, 5): 1, (3, 0): 1, (4, 3): 1, (5, 4): 1} -+ {(2, 5): 1, (5, 4): 1, (4, 3): 1, (1, 2): 1, (0, 1): 1, (3, 0): 1} - - sage: labels = [[],[1],[1],[2],[2],[2,1],[2]] - sage: G = GrowthDiagram(RuleRSK, labels=labels) -diff --git a/src/sage/combinat/integer_lists/base.pyx b/src/sage/combinat/integer_lists/base.pyx -index 2b3a740fb9..bb1499483f 100644 ---- a/src/sage/combinat/integer_lists/base.pyx -+++ b/src/sage/combinat/integer_lists/base.pyx -@@ -228,16 +228,16 @@ cdef class IntegerListsBackend(object): - sage: from sage.combinat.integer_lists.base import IntegerListsBackend - sage: C = IntegerListsBackend(2, length=3) - sage: C.__getstate__() -- {'ceiling': <sage.combinat.integer_lists.base.Envelope object at ...>, -- 'floor': <sage.combinat.integer_lists.base.Envelope object at ...>, -- 'max_length': 3, -- 'max_part': inf, -- 'max_slope': inf, -+ {'min_sum': 2, - 'max_sum': 2, - 'min_length': 3, -+ 'max_length': 3, - 'min_part': 0, -+ 'max_part': inf, - 'min_slope': -inf, -- 'min_sum': 2} -+ 'max_slope': inf, -+ 'floor': <sage.combinat.integer_lists.base.Envelope object at ...>, -+ 'ceiling': <sage.combinat.integer_lists.base.Envelope object at ...>} - """ - return {"min_sum": self.min_sum, - "max_sum": self.max_sum, -diff --git a/src/sage/combinat/k_tableau.py b/src/sage/combinat/k_tableau.py -index f6f892ba2d..b404229d24 100644 ---- a/src/sage/combinat/k_tableau.py -+++ b/src/sage/combinat/k_tableau.py -@@ -2908,22 +2908,22 @@ class StrongTableau(ClonableList, metaclass=InheritComparisonClasscallMetaclass) - - sage: T = StrongTableau([[-1,-2,-4,7],[-3,6,-6,8],[4,-7],[-5,-8]], 3) - sage: T.cells_head_dictionary() -- {1: [(0, 0)], -- 2: [(0, 1)], -- 3: [(1, 0)], -+ {5: [(3, 0)], - 4: [(2, 0), (0, 2)], -- 5: [(3, 0)], -- 6: [(1, 2)], -+ 8: [(3, 1), (1, 3)], -+ 3: [(1, 0)], - 7: [(2, 1), (0, 3)], -- 8: [(3, 1), (1, 3)]} -+ 1: [(0, 0)], -+ 2: [(0, 1)], -+ 6: [(1, 2)]} - sage: T = StrongTableau([[None, 4, -4, -6, -7, 8, 8, -8], [None, -5, 8, 8, 8], [-3, 6]],3) - sage: T.cells_head_dictionary() - {1: [(2, 0)], -- 2: [(0, 2)], -- 3: [(1, 1)], - 4: [(2, 1), (0, 3)], -- 5: [(0, 4)], -- 6: [(1, 4), (0, 7)]} -+ 3: [(1, 1)], -+ 2: [(0, 2)], -+ 6: [(1, 4), (0, 7)], -+ 5: [(0, 4)]} - sage: StrongTableau([[None, None], [None, -1]], 4).cells_head_dictionary() - {1: [(1, 1)]} - -@@ -4419,21 +4419,21 @@ class StrongTableaux(UniqueRepresentation, Parent): - EXAMPLES:: - - sage: StrongTableaux.cells_head_dictionary([[1,2,4,7],[3,6,6,8],[4,7],[5,8]]) -- {1: [(0, 0)], -- 2: [(0, 1)], -- 3: [(1, 0)], -+ {5: [(3, 0)], - 4: [(2, 0), (0, 2)], -- 5: [(3, 0)], -- 6: [(1, 2)], -+ 8: [(3, 1), (1, 3)], -+ 3: [(1, 0)], - 7: [(2, 1), (0, 3)], -- 8: [(3, 1), (1, 3)]} -+ 1: [(0, 0)], -+ 2: [(0, 1)], -+ 6: [(1, 2)]} - sage: StrongTableaux.cells_head_dictionary([[None, 2, 2, 4, 5, 6, 6, 6], [None, 3, 6, 6, 6], [1, 4]]) - {1: [(2, 0)], -- 2: [(0, 2)], -- 3: [(1, 1)], - 4: [(2, 1), (0, 3)], -- 5: [(0, 4)], -- 6: [(1, 4), (0, 7)]} -+ 3: [(1, 1)], -+ 2: [(0, 2)], -+ 6: [(1, 4), (0, 7)], -+ 5: [(0, 4)]} - - TESTS:: - -diff --git a/src/sage/combinat/matrices/latin.py b/src/sage/combinat/matrices/latin.py -index 5d85d559ac..3095978e9f 100644 ---- a/src/sage/combinat/matrices/latin.py -+++ b/src/sage/combinat/matrices/latin.py -@@ -1100,68 +1100,68 @@ class LatinSquare: - [14, 30, 47], - [15, 31, 47]], - {(0, 16, 32): (0, 0, 0), -- (0, 20, 36): (1, 0, 0), -- (0, 24, 40): (2, 0, 0), -- (0, 28, 44): (3, 0, 0), - (1, 17, 32): (0, 0, 1), -- (1, 21, 36): (1, 0, 1), -- (1, 25, 40): (2, 0, 1), -- (1, 29, 44): (3, 0, 1), - (2, 18, 32): (0, 0, 2), -- (2, 22, 36): (1, 0, 2), -- (2, 26, 40): (2, 0, 2), -- (2, 30, 44): (3, 0, 2), - (3, 19, 32): (0, 0, 3), -- (3, 23, 36): (1, 0, 3), -- (3, 27, 40): (2, 0, 3), -- (3, 31, 44): (3, 0, 3), - (4, 16, 33): (0, 1, 0), -- (4, 20, 37): (1, 1, 0), -- (4, 24, 41): (2, 1, 0), -- (4, 28, 45): (3, 1, 0), - (5, 17, 33): (0, 1, 1), -- (5, 21, 37): (1, 1, 1), -- (5, 25, 41): (2, 1, 1), -- (5, 29, 45): (3, 1, 1), - (6, 18, 33): (0, 1, 2), -- (6, 22, 37): (1, 1, 2), -- (6, 26, 41): (2, 1, 2), -- (6, 30, 45): (3, 1, 2), - (7, 19, 33): (0, 1, 3), -- (7, 23, 37): (1, 1, 3), -- (7, 27, 41): (2, 1, 3), -- (7, 31, 45): (3, 1, 3), - (8, 16, 34): (0, 2, 0), -- (8, 20, 38): (1, 2, 0), -- (8, 24, 42): (2, 2, 0), -- (8, 28, 46): (3, 2, 0), - (9, 17, 34): (0, 2, 1), -- (9, 21, 38): (1, 2, 1), -- (9, 25, 42): (2, 2, 1), -- (9, 29, 46): (3, 2, 1), - (10, 18, 34): (0, 2, 2), -- (10, 22, 38): (1, 2, 2), -- (10, 26, 42): (2, 2, 2), -- (10, 30, 46): (3, 2, 2), - (11, 19, 34): (0, 2, 3), -- (11, 23, 38): (1, 2, 3), -- (11, 27, 42): (2, 2, 3), -- (11, 31, 46): (3, 2, 3), - (12, 16, 35): (0, 3, 0), -- (12, 20, 39): (1, 3, 0), -- (12, 24, 43): (2, 3, 0), -- (12, 28, 47): (3, 3, 0), - (13, 17, 35): (0, 3, 1), -- (13, 21, 39): (1, 3, 1), -- (13, 25, 43): (2, 3, 1), -- (13, 29, 47): (3, 3, 1), - (14, 18, 35): (0, 3, 2), -- (14, 22, 39): (1, 3, 2), -- (14, 26, 43): (2, 3, 2), -- (14, 30, 47): (3, 3, 2), - (15, 19, 35): (0, 3, 3), -+ (0, 20, 36): (1, 0, 0), -+ (1, 21, 36): (1, 0, 1), -+ (2, 22, 36): (1, 0, 2), -+ (3, 23, 36): (1, 0, 3), -+ (4, 20, 37): (1, 1, 0), -+ (5, 21, 37): (1, 1, 1), -+ (6, 22, 37): (1, 1, 2), -+ (7, 23, 37): (1, 1, 3), -+ (8, 20, 38): (1, 2, 0), -+ (9, 21, 38): (1, 2, 1), -+ (10, 22, 38): (1, 2, 2), -+ (11, 23, 38): (1, 2, 3), -+ (12, 20, 39): (1, 3, 0), -+ (13, 21, 39): (1, 3, 1), -+ (14, 22, 39): (1, 3, 2), - (15, 23, 39): (1, 3, 3), -+ (0, 24, 40): (2, 0, 0), -+ (1, 25, 40): (2, 0, 1), -+ (2, 26, 40): (2, 0, 2), -+ (3, 27, 40): (2, 0, 3), -+ (4, 24, 41): (2, 1, 0), -+ (5, 25, 41): (2, 1, 1), -+ (6, 26, 41): (2, 1, 2), -+ (7, 27, 41): (2, 1, 3), -+ (8, 24, 42): (2, 2, 0), -+ (9, 25, 42): (2, 2, 1), -+ (10, 26, 42): (2, 2, 2), -+ (11, 27, 42): (2, 2, 3), -+ (12, 24, 43): (2, 3, 0), -+ (13, 25, 43): (2, 3, 1), -+ (14, 26, 43): (2, 3, 2), - (15, 27, 43): (2, 3, 3), -+ (0, 28, 44): (3, 0, 0), -+ (1, 29, 44): (3, 0, 1), -+ (2, 30, 44): (3, 0, 2), -+ (3, 31, 44): (3, 0, 3), -+ (4, 28, 45): (3, 1, 0), -+ (5, 29, 45): (3, 1, 1), -+ (6, 30, 45): (3, 1, 2), -+ (7, 31, 45): (3, 1, 3), -+ (8, 28, 46): (3, 2, 0), -+ (9, 29, 46): (3, 2, 1), -+ (10, 30, 46): (3, 2, 2), -+ (11, 31, 46): (3, 2, 3), -+ (12, 28, 47): (3, 3, 0), -+ (13, 29, 47): (3, 3, 1), -+ (14, 30, 47): (3, 3, 2), - (15, 31, 47): (3, 3, 3)}) - """ - -@@ -2770,12 +2770,12 @@ def dlxcpp_rows_and_map(P): - [2, 6, 11], - [3, 7, 11]], - {(0, 4, 8): (0, 0, 0), -- (0, 6, 10): (1, 0, 0), - (1, 5, 8): (0, 0, 1), -- (1, 7, 10): (1, 0, 1), - (2, 4, 9): (0, 1, 0), -- (2, 6, 11): (1, 1, 0), - (3, 5, 9): (0, 1, 1), -+ (0, 6, 10): (1, 0, 0), -+ (1, 7, 10): (1, 0, 1), -+ (2, 6, 11): (1, 1, 0), - (3, 7, 11): (1, 1, 1)}) - """ - assert P.nrows() == P.ncols() -diff --git a/src/sage/combinat/multiset_partition_into_sets_ordered.py b/src/sage/combinat/multiset_partition_into_sets_ordered.py -index 2b15f9cb89..4af9798c2a 100755 ---- a/src/sage/combinat/multiset_partition_into_sets_ordered.py -+++ b/src/sage/combinat/multiset_partition_into_sets_ordered.py -@@ -1497,15 +1497,15 @@ class OrderedMultisetPartitionsIntoSets(UniqueRepresentation, Parent): - - sage: c = {"length":4, "max_order":6, "alphabet":[2,4,5,6]} - sage: OrderedMultisetPartitionsIntoSets(**c).constraints -- {'alphabet': frozenset({2, 4, 5, 6}), 'length': 4, 'max_order': 6} -+ {'length': 4, 'max_order': 6, 'alphabet': frozenset({2, 4, 5, 6})} - sage: OrderedMultisetPartitionsIntoSets(17, **c).constraints -- {'alphabet': frozenset({2, 4, 5, 6}), 'length': 4, 'max_order': 6} -+ {'length': 4, 'max_order': 6, 'alphabet': frozenset({2, 4, 5, 6})} - sage: OrderedMultisetPartitionsIntoSets(17, **c).full_constraints -- {'alphabet': frozenset({2, 4, 5, 6}), 'length': 4, 'max_order': 6, 'size': 17} -+ {'size': 17, 'length': 4, 'max_order': 6, 'alphabet': frozenset({2, 4, 5, 6})} - - sage: c = {"length":4, "min_length":5, "max_order":6, "order":5, "alphabet":4} - sage: OrderedMultisetPartitionsIntoSets(**c).full_constraints -- {'alphabet': frozenset({1, 2, 3, 4}), 'length': 4, 'order': 5} -+ {'alphabet': frozenset({1, 2, 3, 4}), 'order': 5, 'length': 4} - sage: OrderedMultisetPartitionsIntoSets(**c).constraints - {'length': 4} - sage: OrderedMultisetPartitionsIntoSets(4, 5, **c).constraints -diff --git a/src/sage/combinat/ncsf_qsym/tutorial.py b/src/sage/combinat/ncsf_qsym/tutorial.py -index ac452cdb14..dc1af4a512 100644 ---- a/src/sage/combinat/ncsf_qsym/tutorial.py -+++ b/src/sage/combinat/ncsf_qsym/tutorial.py -@@ -115,7 +115,7 @@ degrees, and the support:: - [M[1, 2], M[3, 3], M[6]] - - sage: z.monomial_coefficients() -- {[1, 2]: 3, [3, 3]: 2, [6]: 1} -+ {[3, 3]: 2, [6]: 1, [1, 2]: 3} - - As with the symmetric functions package, the quasisymmetric function ``1`` - has several instantiations. However, the most obvious way to write ``1`` -diff --git a/src/sage/combinat/parallelogram_polyomino.py b/src/sage/combinat/parallelogram_polyomino.py -index 4dc32a7c06..0f4d7d60d9 100644 ---- a/src/sage/combinat/parallelogram_polyomino.py -+++ b/src/sage/combinat/parallelogram_polyomino.py -@@ -557,16 +557,16 @@ EXAMPLES:: - ....: ) - sage: opt = ParallelogramPolyominoesOptions['tikz_options'] - sage: opt -- {'color_bounce_0': u'red', -- 'color_bounce_1': u'blue', -- 'color_line': u'black', -- 'color_point': u'black', -+ {'scale': 1, - 'line_size': 1, -- 'mirror': None, - 'point_size': 3.5, -+ 'color_line': u'black', -+ 'color_point': u'black', -+ 'color_bounce_0': u'red', -+ 'color_bounce_1': u'blue', -+ 'translation': [0, 0], - 'rotation': 0, -- 'scale': 1, -- 'translation': [0, 0]} -+ 'mirror': None} - """ - - -@@ -2564,16 +2564,16 @@ class ParallelogramPolyomino(ClonableList, - - sage: pp = ParallelogramPolyomino([[0, 1], [1, 0]]) - sage: pp.get_tikz_options() -- {'color_bounce_0': u'red', -- 'color_bounce_1': u'blue', -- 'color_line': u'black', -- 'color_point': u'black', -+ {'scale': 1, - 'line_size': 1, -- 'mirror': None, - 'point_size': 3.5, -+ 'color_line': u'black', -+ 'color_point': u'black', -+ 'color_bounce_0': u'red', -+ 'color_bounce_1': u'blue', -+ 'translation': [0, 0], - 'rotation': 0, -- 'scale': 1, -- 'translation': [0, 0]} -+ 'mirror': None} - """ - return self.get_options()['tikz_options'] - -diff --git a/src/sage/combinat/partition.py b/src/sage/combinat/partition.py -index 9727c06b6e..58620965b0 100644 ---- a/src/sage/combinat/partition.py -+++ b/src/sage/combinat/partition.py -@@ -3764,11 +3764,11 @@ class Partition(CombinatorialElement): - EXAMPLES:: - - sage: Partition([4,3,2]).block(0) -- {-2: 1, -1: 2, 0: 2, 1: 2, 2: 1, 3: 1} -+ {0: 2, 1: 2, 2: 1, 3: 1, -1: 2, -2: 1} - sage: Partition([4,3,2]).block(2) - {0: 4, 1: 5} - sage: Partition([4,3,2]).block(2, multicharge=(1,)) -- {0: 5, 1: 4} -+ {1: 4, 0: 5} - sage: Partition([4,3,2]).block(3) - {0: 3, 1: 3, 2: 3} - sage: Partition([4,3,2]).block(4) -diff --git a/src/sage/combinat/partition_kleshchev.py b/src/sage/combinat/partition_kleshchev.py -index e257781f1c..5fb6e27a87 100644 ---- a/src/sage/combinat/partition_kleshchev.py -+++ b/src/sage/combinat/partition_kleshchev.py -@@ -129,14 +129,14 @@ class KleshchevPartition(Partition): - - sage: KP = KleshchevPartitions(3, convention="regular") - sage: KP([5,4,4,3,2]).conormal_cells() -- {0: [(1, 4)], 1: [(5, 0), (4, 2)]} -+ {1: [(5, 0), (4, 2)], 0: [(1, 4)]} - sage: KP([5,4,4,3,2]).conormal_cells(0) - [(1, 4)] - sage: KP([5,4,4,3,2]).conormal_cells(1) - [(5, 0), (4, 2)] - sage: KP = KleshchevPartitions(3, convention="restricted") - sage: KP([5,4,4,3,2]).conormal_cells() -- {0: [(1, 4), (3, 3)], 2: [(0, 5)]} -+ {2: [(0, 5)], 0: [(1, 4), (3, 3)]} - """ - # We use a dictionary for the conormal nodes as the indexing set is Z when e=0 - conormals = defaultdict(list) # the conormal cells of each residue -@@ -190,14 +190,14 @@ class KleshchevPartition(Partition): - - sage: KP = KleshchevPartitions(3, convention="regular") - sage: KP([5,4,4,3,2]).cogood_cells() -- {0: (1, 4), 1: (4, 2)} -+ {1: (4, 2), 0: (1, 4)} - sage: KP([5,4,4,3,2]).cogood_cells(0) - (1, 4) - sage: KP([5,4,4,3,2]).cogood_cells(1) - (4, 2) - sage: KP = KleshchevPartitions(4, convention='restricted') - sage: KP([5,4,4,3,2]).cogood_cells() -- {1: (0, 5), 2: (4, 2), 3: (1, 4)} -+ {1: (0, 5), 3: (1, 4), 2: (4, 2)} - sage: KP([5,4,4,3,2]).cogood_cells(0) - sage: KP([5,4,4,3,2]).cogood_cells(2) - (4, 2) -@@ -513,8 +513,8 @@ class KleshchevPartitionTuple(PartitionTuple): - - sage: KP = KleshchevPartitions(3, [0,1], convention="left regular") - sage: KP([[4, 2], [5, 3, 1]]).conormal_cells() -- {0: [(1, 2, 1), (1, 1, 3), (1, 0, 5)], -- 1: [(1, 3, 0), (0, 2, 0), (0, 1, 2), (0, 0, 4)]} -+ {1: [(1, 3, 0), (0, 2, 0), (0, 1, 2), (0, 0, 4)], -+ 0: [(1, 2, 1), (1, 1, 3), (1, 0, 5)]} - sage: KP([[4, 2], [5, 3, 1]]).conormal_cells(1) - [(1, 3, 0), (0, 2, 0), (0, 1, 2), (0, 0, 4)] - sage: KP([[4, 2], [5, 3, 1]]).conormal_cells(2) -@@ -583,13 +583,13 @@ class KleshchevPartitionTuple(PartitionTuple): - sage: KP = KleshchevPartitions(3, [0,1]) - sage: pt = KP([[4, 2], [5, 3, 1]]) - sage: pt.cogood_cells() -- {0: (1, 2, 1), 1: (1, 3, 0)} -+ {1: (1, 3, 0), 0: (1, 2, 1)} - sage: pt.cogood_cells(0) - (1, 2, 1) - sage: KP = KleshchevPartitions(4, [0,1], convention="left regular") - sage: pt = KP([[5, 2, 2], [6, 1, 1]]) - sage: pt.cogood_cells() -- {1: (0, 0, 5), 2: (1, 3, 0)} -+ {2: (1, 3, 0), 1: (0, 0, 5)} - sage: pt.cogood_cells(0) is None - True - sage: pt.cogood_cells(1) is None -@@ -711,7 +711,7 @@ class KleshchevPartitionTuple(PartitionTuple): - sage: KP = KleshchevPartitions(4, [0,1], convention="left regular") - sage: pt = KP([[5, 2, 2], [6, 2, 1]]) - sage: pt.good_cells() -- {0: (0, 0, 4), 2: (1, 0, 5), 3: (0, 2, 1)} -+ {0: (0, 0, 4), 3: (0, 2, 1), 2: (1, 0, 5)} - sage: pt.good_cells(1) is None - True - """ -diff --git a/src/sage/combinat/partition_tuple.py b/src/sage/combinat/partition_tuple.py -index f3b6c05e40..14ca35d517 100644 ---- a/src/sage/combinat/partition_tuple.py -+++ b/src/sage/combinat/partition_tuple.py -@@ -1682,7 +1682,7 @@ class PartitionTuple(CombinatorialElement): - EXAMPLES:: - - sage: PartitionTuple([[2,2],[2,2]]).block(0,(0,0)) -- {-1: 2, 0: 4, 1: 2} -+ {0: 4, 1: 2, -1: 2} - sage: PartitionTuple([[2,2],[2,2]]).block(2,(0,0)) - {0: 4, 1: 4} - sage: PartitionTuple([[2,2],[2,2]]).block(2,(0,1)) -diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/posets.py -index 2795700652..88186e8d0f 100644 ---- a/src/sage/combinat/posets/posets.py -+++ b/src/sage/combinat/posets/posets.py -@@ -4041,7 +4041,7 @@ class FinitePoset(UniqueRepresentation, Parent): - Since :trac:`25576`, one can ask for the isomorphism:: - - sage: P.is_isomorphic(Q, certificate=True) -- (True, {1: 4, 2: 5, 3: 6}) -+ (True, {2: 5, 1: 4, 3: 6}) - """ - if hasattr(other, 'hasse_diagram'): - return self.hasse_diagram().is_isomorphic(other.hasse_diagram(), -@@ -7589,60 +7589,60 @@ class FinitePoset(UniqueRepresentation, Parent): - sage: G.edges(sort=True) - [((-1, 0), (0, -13), None), ((-1, 0), (0, 12), None), ((-1, 0), (0, 14), None), ((-1, 0), (0, 16), None), ((0, -13), (1, -13), None), ((0, -13), (1, 12), None), ((0, -13), (1, 14), None), ((0, -13), (1, 16), None), ((0, 12), (1, 12), None), ((0, 14), (1, 12), None), ((0, 14), (1, 14), None), ((0, 16), (1, 12), None), ((0, 16), (1, 16), None), ((1, -13), (2, 0), None), ((1, 12), (2, 0), None), ((1, 14), (2, 0), None), ((1, 16), (2, 0), None)] - sage: e -- {((-1, 0), (0, -13)): 0, -+ {((-1, 0), (0, 14)): 0, -+ ((-1, 0), (0, -13)): 0, - ((-1, 0), (0, 12)): 0, -- ((-1, 0), (0, 14)): 0, - ((-1, 0), (0, 16)): 0, -- ((0, -13), (1, -13)): 1, -+ ((1, 12), (2, 0)): 0, -+ ((0, 14), (1, 12)): 0, -+ ((0, 14), (1, 14)): 1, -+ ((1, 16), (2, 0)): 0, - ((0, -13), (1, 12)): 0, -- ((0, -13), (1, 14)): 0, - ((0, -13), (1, 16)): 0, -+ ((0, -13), (1, 14)): 0, -+ ((0, -13), (1, -13)): 1, -+ ((1, 14), (2, 0)): 0, - ((0, 12), (1, 12)): 1, -- ((0, 14), (1, 12)): 0, -- ((0, 14), (1, 14)): 1, - ((0, 16), (1, 12)): 0, - ((0, 16), (1, 16)): 1, -- ((1, -13), (2, 0)): 0, -- ((1, 12), (2, 0)): 0, -- ((1, 14), (2, 0)): 0, -- ((1, 16), (2, 0)): 0} -+ ((1, -13), (2, 0)): 0} - sage: qs = [[1,2,3,4,5,6,7,8,9],[[1,3],[3,4],[5,7],[1,9],[2,3]]] - sage: Poset(qs).frank_network() - (Digraph on 20 vertices, -- {((-1, 0), (0, 1)): 0, -+ {((1, 3), (2, 0)): 0, -+ ((-1, 0), (0, 6)): 0, -+ ((-1, 0), (0, 7)): 0, -+ ((-1, 0), (0, 9)): 0, - ((-1, 0), (0, 2)): 0, - ((-1, 0), (0, 3)): 0, - ((-1, 0), (0, 4)): 0, - ((-1, 0), (0, 5)): 0, -- ((-1, 0), (0, 6)): 0, -- ((-1, 0), (0, 7)): 0, - ((-1, 0), (0, 8)): 0, -- ((-1, 0), (0, 9)): 0, -- ((0, 1), (1, 1)): 1, -- ((0, 2), (1, 2)): 1, -- ((0, 3), (1, 1)): 0, -- ((0, 3), (1, 2)): 0, -+ ((-1, 0), (0, 1)): 0, -+ ((0, 7), (1, 7)): 1, -+ ((0, 7), (1, 5)): 0, -+ ((1, 6), (2, 0)): 0, - ((0, 3), (1, 3)): 1, -- ((0, 4), (1, 1)): 0, -- ((0, 4), (1, 2)): 0, -+ ((0, 3), (1, 2)): 0, -+ ((0, 3), (1, 1)): 0, -+ ((1, 2), (2, 0)): 0, -+ ((1, 5), (2, 0)): 0, - ((0, 4), (1, 3)): 0, -+ ((0, 4), (1, 2)): 0, -+ ((0, 4), (1, 1)): 0, - ((0, 4), (1, 4)): 1, -+ ((1, 1), (2, 0)): 0, -+ ((1, 4), (2, 0)): 0, - ((0, 5), (1, 5)): 1, -- ((0, 6), (1, 6)): 1, -- ((0, 7), (1, 5)): 0, -- ((0, 7), (1, 7)): 1, -+ ((1, 9), (2, 0)): 0, - ((0, 8), (1, 8)): 1, -+ ((0, 1), (1, 1)): 1, -+ ((1, 8), (2, 0)): 0, -+ ((0, 6), (1, 6)): 1, -+ ((1, 7), (2, 0)): 0, - ((0, 9), (1, 1)): 0, - ((0, 9), (1, 9)): 1, -- ((1, 1), (2, 0)): 0, -- ((1, 2), (2, 0)): 0, -- ((1, 3), (2, 0)): 0, -- ((1, 4), (2, 0)): 0, -- ((1, 5), (2, 0)): 0, -- ((1, 6), (2, 0)): 0, -- ((1, 7), (2, 0)): 0, -- ((1, 8), (2, 0)): 0, -- ((1, 9), (2, 0)): 0}) -+ ((0, 2), (1, 2)): 1}) - - AUTHOR: - -diff --git a/src/sage/combinat/root_system/weyl_characters.py b/src/sage/combinat/root_system/weyl_characters.py -index 744fcda226..02a682b381 100644 ---- a/src/sage/combinat/root_system/weyl_characters.py -+++ b/src/sage/combinat/root_system/weyl_characters.py -@@ -640,7 +640,7 @@ class WeylCharacterRing(CombinatorialFreeModule): - - sage: B2 = WeylCharacterRing("B2", style="coroots") - sage: [B2._demazure_weights(v, word=[1,2]) for v in B2.fundamental_weights()] -- [{(1, 0): 1, (0, 1): 1}, {(-1/2, 1/2): 1, (1/2, -1/2): 1, (1/2, 1/2): 1}] -+ [{(1, 0): 1, (0, 1): 1}, {(1/2, 1/2): 1, (1/2, -1/2): 1, (-1/2, 1/2): 1}] - """ - alphacheck = self._space.simple_coroots() - dd = {} -@@ -666,7 +666,7 @@ class WeylCharacterRing(CombinatorialFreeModule): - sage: A2 = WeylCharacterRing("A2",style="coroots") - sage: dd = {}; dd[(1,1)]=int(1) - sage: A2._demazure_helper(dd,word=[1,2]) -- {(0, 0, 0): 1, (-1, 1, 0): 1, (1, -1, 0): 1, (1, 0, -1): 1, (0, 1, -1): 1} -+ {(1, 0, -1): 1, (0, 1, -1): 1, (1, -1, 0): 1, (0, 0, 0): 1, (-1, 1, 0): 1} - """ - if self._style != "coroots": - raise ValueError('_demazure_helper method unavailable. Use style="coroots".') -@@ -724,7 +724,7 @@ class WeylCharacterRing(CombinatorialFreeModule): - sage: B2 = WeylCharacterRing("B2",style="coroots") - sage: chi = 2*B2(1,0) - sage: B2._weight_multiplicities(chi) -- {(0, 0): 2, (-1, 0): 2, (1, 0): 2, (0, -1): 2, (0, 1): 2} -+ {(1, 0): 2, (0, 1): 2, (0, 0): 2, (0, -1): 2, (-1, 0): 2} - """ - d = {} - m = x._monomial_coefficients -@@ -988,12 +988,12 @@ class WeylCharacterRing(CombinatorialFreeModule): - sage: v = A2._space([3,1,0]); v - (3, 1, 0) - sage: d = dict([(x,1) for x in v.orbit()]); d -- {(1, 3, 0): 1, -- (1, 0, 3): 1, -- (3, 1, 0): 1, -+ {(3, 1, 0): 1, -+ (1, 3, 0): 1, - (3, 0, 1): 1, -- (0, 1, 3): 1, -- (0, 3, 1): 1} -+ (1, 0, 3): 1, -+ (0, 3, 1): 1, -+ (0, 1, 3): 1} - sage: A2.char_from_weights(d) - -A2(2,1,1) - A2(2,2,0) + A2(3,1,0) - """ -@@ -1017,7 +1017,7 @@ class WeylCharacterRing(CombinatorialFreeModule): - sage: v = A2._space([3,1,0]) - sage: d = dict([(x,1) for x in v.orbit()]) - sage: A2._char_from_weights(d) -- {(2, 1, 1): -1, (2, 2, 0): -1, (3, 1, 0): 1} -+ {(3, 1, 0): 1, (2, 2, 0): -1, (2, 1, 1): -1} - """ - hdict = {} - ddict = mdict.copy() -@@ -1531,7 +1531,7 @@ class WeylCharacterRing(CombinatorialFreeModule): - - sage: B2 = WeylCharacterRing("B2",style="coroots") - sage: B2(0,1).weight_multiplicities() -- {(-1/2, -1/2): 1, (-1/2, 1/2): 1, (1/2, -1/2): 1, (1/2, 1/2): 1} -+ {(1/2, 1/2): 1, (1/2, -1/2): 1, (-1/2, 1/2): 1, (-1/2, -1/2): 1} - """ - return self.parent()._weight_multiplicities(self) - -@@ -1622,8 +1622,13 @@ def irreducible_character_freudenthal(hwv, debug=False): - EXAMPLES:: - - sage: WeylCharacterRing("A2")(2,1,0).weight_multiplicities() # indirect doctest -- {(1, 1, 1): 2, (1, 2, 0): 1, (1, 0, 2): 1, (2, 1, 0): 1, -- (2, 0, 1): 1, (0, 1, 2): 1, (0, 2, 1): 1} -+ {(2, 1, 0): 1, -+ (1, 2, 0): 1, -+ (2, 0, 1): 1, -+ (1, 1, 1): 2, -+ (0, 2, 1): 1, -+ (1, 0, 2): 1, -+ (0, 1, 2): 1} - """ - L = hwv.parent() - rho = L.rho() -diff --git a/src/sage/combinat/set_partition.py b/src/sage/combinat/set_partition.py -index fecf9055cd..3cc443cfc4 100644 ---- a/src/sage/combinat/set_partition.py -+++ b/src/sage/combinat/set_partition.py -@@ -624,13 +624,13 @@ class SetPartition(AbstractSetPartition, - sage: SP.set_latex_options(tikz_scale=2,plot='linear',fill=True,color='blue',angle=45) - sage: SP.set_latex_options(plot='cyclic') - sage: SP.latex_options() -- {'angle': 45, -- 'color': 'blue', -- 'fill': True, -+ {'tikz_scale': 2, - 'plot': 'cyclic', -- 'radius': '1cm', -+ 'fill': True, -+ 'color': 'blue', -+ 'angle': 45, - 'show_labels': True, -- 'tikz_scale': 2} -+ 'radius': '1cm'} - - """ - valid_args = ['tikz_scale', 'plot', 'color', 'fill', 'show_labels', -@@ -658,13 +658,13 @@ class SetPartition(AbstractSetPartition, - EXAMPLES:: - - sage: SP = SetPartition([[1,6], [3,5,4]]); SP.latex_options() -- {'angle': 0, -+ {'tikz_scale': 1, -+ 'plot': None, - 'color': 'black', - 'fill': False, -- 'plot': None, -- 'radius': '1cm', - 'show_labels': True, -- 'tikz_scale': 1} -+ 'radius': '1cm', -+ 'angle': 0} - """ - opts = self._latex_options.copy() - if "tikz_scale" not in opts: -diff --git a/src/sage/combinat/similarity_class_type.py b/src/sage/combinat/similarity_class_type.py -index ec3676a710..23a397daa7 100644 ---- a/src/sage/combinat/similarity_class_type.py -+++ b/src/sage/combinat/similarity_class_type.py -@@ -1591,7 +1591,7 @@ def matrix_centralizer_cardinalities_length_two(n, q = None, selftranspose = Fal - (q^4 - q^2, 1/2*q^4 - 1/2*q^3)] - sage: from sage.combinat.similarity_class_type import dictionary_from_generator - sage: dictionary_from_generator(matrix_centralizer_cardinalities_length_two(2, q = 2)) -- {4: 4, 8: 8, 12: 4, 16: 2, 32: 4, 48: 2, 96: 4} -+ {32: 4, 96: 4, 4: 4, 8: 8, 12: 4, 16: 2, 48: 2} - """ - if q is None: - q = FractionField(QQ['q']).gen() -diff --git a/src/sage/combinat/symmetric_group_representations.py b/src/sage/combinat/symmetric_group_representations.py -index 554b161bf3..15ef6c0b89 100644 ---- a/src/sage/combinat/symmetric_group_representations.py -+++ b/src/sage/combinat/symmetric_group_representations.py -@@ -538,8 +538,8 @@ class YoungRepresentation_generic(SymmetricGroupRepresentation_generic_class): - sage: orth._tableau_dict - {(0, -1, 2, 1, 0): [[1, 2, 3], [4, 5]], - (0, 2, -1, 1, 0): [[1, 2, 4], [3, 5]], -- (0, 2, 1, -1, 0): [[1, 3, 4], [2, 5]], - (2, 0, -1, 1, 0): [[1, 2, 5], [3, 4]], -+ (0, 2, 1, -1, 0): [[1, 3, 4], [2, 5]], - (2, 0, 1, -1, 0): [[1, 3, 5], [2, 4]]} - """ - # construct a dictionary pairing vertices with tableau -@@ -563,8 +563,8 @@ class YoungRepresentation_generic(SymmetricGroupRepresentation_generic_class): - sage: orth._word_dict - {(0, -1, 2, 1, 0): (4, 5, 1, 2, 3), - (0, 2, -1, 1, 0): (3, 5, 1, 2, 4), -- (0, 2, 1, -1, 0): (2, 5, 1, 3, 4), - (2, 0, -1, 1, 0): (3, 4, 1, 2, 5), -+ (0, 2, 1, -1, 0): (2, 5, 1, 3, 4), - (2, 0, 1, -1, 0): (2, 4, 1, 3, 5)} - """ - word_dict = {} -diff --git a/src/sage/combinat/words/finite_word.py b/src/sage/combinat/words/finite_word.py -index 9406087ff8..e2c7d47fe0 100644 ---- a/src/sage/combinat/words/finite_word.py -+++ b/src/sage/combinat/words/finite_word.py -@@ -4828,9 +4828,9 @@ class FiniteWord_class(Word_class): - EXAMPLES:: - - sage: Word([2,1,4,2,3,4,2]).evaluation_dict() -- {1: 1, 2: 3, 3: 1, 4: 2} -+ {2: 3, 1: 1, 4: 2, 3: 1} - sage: Word('badbcdb').evaluation_dict() -- {'a': 1, 'b': 3, 'c': 1, 'd': 2} -+ {'b': 3, 'a': 1, 'd': 2, 'c': 1} - sage: Word().evaluation_dict() - {} - -@@ -7105,9 +7105,9 @@ def evaluation_dict(w): - - sage: from sage.combinat.words.finite_word import evaluation_dict - sage: evaluation_dict([2,1,4,2,3,4,2]) -- {1: 1, 2: 3, 3: 1, 4: 2} -+ {2: 3, 1: 1, 4: 2, 3: 1} - sage: evaluation_dict('badbcdb') -- {'a': 1, 'b': 3, 'c': 1, 'd': 2} -+ {'b': 3, 'a': 1, 'd': 2, 'c': 1} - sage: evaluation_dict([]) - {} - -diff --git a/src/sage/combinat/words/suffix_trees.py b/src/sage/combinat/words/suffix_trees.py -index daaa592cb7..53da37127d 100644 ---- a/src/sage/combinat/words/suffix_trees.py -+++ b/src/sage/combinat/words/suffix_trees.py -@@ -1652,7 +1652,12 @@ class DecoratedSuffixTree(ImplicitSuffixTree): - sage: w = Word('abaababbabba') - sage: T = DecoratedSuffixTree(w) - sage: T._partial_labeling() -- {(3, 4): [1], (5, 1): [3], (5, 6): [1], (11, 17): [1], (13, 8): [1], (15, 10): [2]} -+ {(3, 4): [1], -+ (5, 1): [3], -+ (5, 6): [1], -+ (15, 10): [2], -+ (13, 8): [1], -+ (11, 17): [1]} - """ - def node_processing(node, parent, head): - r""" -diff --git a/src/sage/combinat/words/words.py b/src/sage/combinat/words/words.py -index 47327fab0c..3557ae6ca8 100644 ---- a/src/sage/combinat/words/words.py -+++ b/src/sage/combinat/words/words.py -@@ -1668,8 +1668,8 @@ class FiniteOrInfiniteWords(AbstractLanguage): - EXAMPLES:: - - sage: Words('ab')._element_classes -- {'iter': <class 'sage.combinat.words.word.Word_iter'>, -- 'iter_with_caching': <class 'sage.combinat.words.word.Word_iter_with_caching'>} -+ {'iter_with_caching': <class 'sage.combinat.words.word.Word_iter_with_caching'>, -+ 'iter': <class 'sage.combinat.words.word.Word_iter'>} - """ - import sage.combinat.words.word as word - return {'iter_with_caching': word.Word_iter_with_caching, -diff --git a/src/sage/crypto/mq/sr.py b/src/sage/crypto/mq/sr.py -index 736dd315ab..698f3fe308 100644 ---- a/src/sage/crypto/mq/sr.py -+++ b/src/sage/crypto/mq/sr.py -@@ -1652,49 +1652,49 @@ class SR_generic(MPolynomialSystemGenerator): - - sage: sr = mq.SR(1,1,1,4) - sage: sr.variable_dict() -- {'k000': k000, -- 'k001': k001, -- 'k002': k002, -- 'k003': k003, -- 'k100': k100, -+ {'k100': k100, - 'k101': k101, - 'k102': k102, - 'k103': k103, -- 's000': s000, -- 's001': s001, -- 's002': s002, -- 's003': s003, -+ 'x100': x100, -+ 'x101': x101, -+ 'x102': x102, -+ 'x103': x103, - 'w100': w100, - 'w101': w101, - 'w102': w102, - 'w103': w103, -- 'x100': x100, -- 'x101': x101, -- 'x102': x102, -- 'x103': x103} -+ 's000': s000, -+ 's001': s001, -+ 's002': s002, -+ 's003': s003, -+ 'k000': k000, -+ 'k001': k001, -+ 'k002': k002, -+ 'k003': k003} - - sage: sr = mq.SR(1,1,1,4,gf2=True) - sage: sr.variable_dict() -- {'k000': k000, -- 'k001': k001, -- 'k002': k002, -- 'k003': k003, -- 'k100': k100, -+ {'k100': k100, - 'k101': k101, - 'k102': k102, - 'k103': k103, -- 's000': s000, -- 's001': s001, -- 's002': s002, -- 's003': s003, -+ 'x100': x100, -+ 'x101': x101, -+ 'x102': x102, -+ 'x103': x103, - 'w100': w100, - 'w101': w101, - 'w102': w102, - 'w103': w103, -- 'x100': x100, -- 'x101': x101, -- 'x102': x102, -- 'x103': x103} -+ 's000': s000, -+ 's001': s001, -+ 's002': s002, -+ 's003': s003, -+ 'k000': k000, -+ 'k001': k001, -+ 'k002': k002, -+ 'k003': k003} - - """ - try: -diff --git a/src/sage/databases/sql_db.py b/src/sage/databases/sql_db.py -index 71e811e861..70e3afcc06 100644 ---- a/src/sage/databases/sql_db.py -+++ b/src/sage/databases/sql_db.py -@@ -160,10 +160,10 @@ def verify_column(col_dict): - sage: from sage.databases.sql_db import verify_column - sage: col = {'sql':'BOOLEAN'} - sage: verify_column(col) -- {'index': False, 'primary_key': False, 'sql': 'BOOLEAN', 'unique': False} -+ {'primary_key': False, 'index': False, 'unique': False, 'sql': 'BOOLEAN'} - sage: col = {'primary_key':True, 'sql':'INTEGER'} - sage: verify_column(col) -- {'index': True, 'primary_key': True, 'sql': 'INTEGER', 'unique': True} -+ {'primary_key': True, 'index': True, 'unique': True, 'sql': 'INTEGER'} - sage: verify_column({}) - Traceback (most recent call last): - ... -@@ -1799,14 +1799,14 @@ class SQLDatabase(SageObject): - sage: MonicPolys.create_table('simon', {'n':{'sql':'INTEGER', 'index':True}, 'n2':{'sql':'INTEGER'}}) - sage: MonicPolys.make_index('n2','simon') - sage: MonicPolys.get_skeleton() -- {'simon': {'n': {'index': True, -- 'primary_key': False, -- 'sql': 'INTEGER', -- 'unique': False}, -- 'n2': {'index': True, -- 'primary_key': False, -- 'sql': 'INTEGER', -- 'unique': False}}} -+ {'simon': {'n': {'primary_key': False, -+ 'index': True, -+ 'unique': False, -+ 'sql': 'INTEGER'}, -+ 'n2': {'primary_key': False, -+ 'index': True, -+ 'unique': False, -+ 'sql': 'INTEGER'}}} - """ - if self.__read_only__: - raise RuntimeError('Cannot modify a read only database.') -@@ -1840,14 +1840,14 @@ class SQLDatabase(SageObject): - sage: MonicPolys.create_table('simon', {'n':{'sql':'INTEGER', 'index':True}, 'n2':{'sql':'INTEGER'}}) - sage: MonicPolys.drop_index('simon', 'n') - sage: MonicPolys.get_skeleton() -- {'simon': {'n': {'index': False, -- 'primary_key': False, -- 'sql': 'INTEGER', -- 'unique': False}, -- 'n2': {'index': False, -- 'primary_key': False, -- 'sql': 'INTEGER', -- 'unique': False}}} -+ {'simon': {'n': {'primary_key': False, -+ 'index': False, -+ 'unique': False, -+ 'sql': 'INTEGER'}, -+ 'n2': {'primary_key': False, -+ 'index': False, -+ 'unique': False, -+ 'sql': 'INTEGER'}}} - """ - if self.__read_only__: - raise RuntimeError('Cannot modify a read only database.') -@@ -1881,14 +1881,14 @@ class SQLDatabase(SageObject): - sage: MonicPolys.create_table('simon', {'n':{'sql':'INTEGER', 'index':True}, 'n2':{'sql':'INTEGER'}}) - sage: MonicPolys.make_unique('simon', 'n2') - sage: MonicPolys.get_skeleton() -- {'simon': {'n': {'index': True, -- 'primary_key': False, -- 'sql': 'INTEGER', -- 'unique': False}, -- 'n2': {'index': False, -- 'primary_key': False, -- 'sql': 'INTEGER', -- 'unique': True}}} -+ {'simon': {'n': {'primary_key': False, -+ 'index': True, -+ 'unique': False, -+ 'sql': 'INTEGER'}, -+ 'n2': {'primary_key': False, -+ 'index': False, -+ 'unique': True, -+ 'sql': 'INTEGER'}}} - - """ - if self.__read_only__: -@@ -1920,14 +1920,14 @@ class SQLDatabase(SageObject): - sage: MonicPolys.make_unique('simon', 'n2') - sage: MonicPolys.drop_unique('simon', 'n2') - sage: MonicPolys.get_skeleton() -- {'simon': {'n': {'index': True, -- 'primary_key': False, -- 'sql': 'INTEGER', -- 'unique': False}, -- 'n2': {'index': False, -- 'primary_key': False, -- 'sql': 'INTEGER', -- 'unique': False}}} -+ {'simon': {'n': {'primary_key': False, -+ 'index': True, -+ 'unique': False, -+ 'sql': 'INTEGER'}, -+ 'n2': {'primary_key': False, -+ 'index': False, -+ 'unique': False, -+ 'sql': 'INTEGER'}}} - """ - if self.__read_only__: - raise RuntimeError('Cannot modify a read only database.') -@@ -1963,14 +1963,14 @@ class SQLDatabase(SageObject): - sage: MonicPolys.create_table('simon', {'n':{'sql':'INTEGER', 'index':True}, 'n2':{'sql':'INTEGER'}}) - sage: MonicPolys.make_primary_key('simon', 'n2') - sage: MonicPolys.get_skeleton() -- {'simon': {'n': {'index': True, -- 'primary_key': False, -- 'sql': 'INTEGER', -- 'unique': False}, -- 'n2': {'index': False, -- 'primary_key': True, -- 'sql': 'INTEGER', -- 'unique': True}}} -+ {'simon': {'n': {'primary_key': False, -+ 'index': True, -+ 'unique': False, -+ 'sql': 'INTEGER'}, -+ 'n2': {'primary_key': True, -+ 'index': False, -+ 'unique': True, -+ 'sql': 'INTEGER'}}} - """ - if self.__read_only__: - raise RuntimeError('Cannot modify a read only database.') -@@ -2007,14 +2007,14 @@ class SQLDatabase(SageObject): - sage: MonicPolys.make_primary_key('simon', 'n2') - sage: MonicPolys.drop_primary_key('simon', 'n2') - sage: MonicPolys.get_skeleton() -- {'simon': {'n': {'index': True, -- 'primary_key': False, -- 'sql': 'INTEGER', -- 'unique': False}, -- 'n2': {'index': False, -- 'primary_key': False, -- 'sql': 'INTEGER', -- 'unique': True}}} -+ {'simon': {'n': {'primary_key': False, -+ 'index': True, -+ 'unique': False, -+ 'sql': 'INTEGER'}, -+ 'n2': {'primary_key': False, -+ 'index': False, -+ 'unique': True, -+ 'sql': 'INTEGER'}}} - """ - if self.__read_only__: - raise RuntimeError('Cannot modify a read only database.') diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py -index c93d1f2d99..7f32509467 100644 +index c93d1f2..838f1a6 100644 --- a/src/sage/doctest/forker.py +++ b/src/sage/doctest/forker.py -@@ -138,7 +138,7 @@ def init_sage(): - dictionary output:: - - sage: {'a':23, 'b':34, 'au':56, 'bbf':234, 'aaa':234} -- {'a': 23, 'aaa': 234, 'au': 56, 'b': 34, 'bbf': 234} -+ {'a': 23, 'b': 34, 'au': 56, 'bbf': 234, 'aaa': 234} - """ - try: - # We need to ensure that the Matplotlib font cache is built to -@@ -182,15 +182,6 @@ def init_sage(): - from sage.repl.rich_output.backend_doctest import BackendDoctest - dm.switch_backend(BackendDoctest()) - -- # IPython's pretty printer sorts the repr of dicts by their keys by default -- # (or their keys' str() if they are not otherwise orderable). However, it -- # disables this for CPython 3.6+ opting to instead display dicts' "natural" +@@ -51,6 +51,7 @@ import tempfile + from dis import findlinestarts + from queue import Empty + import gc ++import IPython.lib.pretty + + import sage.misc.randstate as randstate + from .util import Timer, RecordingDict, count_noun +@@ -86,6 +87,32 @@ _OSError_SUBCLASSES = [ + exc is not OSError + ] + ++def _sorted_dict_pprinter_factory(start, end): ++ """ ++ Modified version of :func:`IPython.lib.pretty._dict_pprinter_factory` ++ that sorts the keys of dictionaries for printing. ++ ++ EXAMPLES:: ++ ++ sage: {2: 0, 1: 0} # indirect doctest ++ {1: 0, 2: 0} ++ """ ++ def inner(obj, p, cycle): ++ if cycle: ++ return p.text('{...}') ++ step = len(start) ++ p.begin_group(step, start) ++ keys = obj.keys() ++ keys = IPython.lib.pretty._sorted_for_pprint(keys) ++ for idx, key in p._enumerate(keys): ++ if idx: ++ p.text(',') ++ p.breakable() ++ p.pretty(key) ++ p.text(': ') ++ p.pretty(obj[key]) ++ p.end_group(step, end) ++ return inner + + + def init_sage(): +@@ -185,11 +212,11 @@ def init_sage(): + # IPython's pretty printer sorts the repr of dicts by their keys by default + # (or their keys' str() if they are not otherwise orderable). However, it + # disables this for CPython 3.6+ opting to instead display dicts' "natural" - # insertion order, which is preserved in those versions). This makes for - # inconsistent results with Python 2 tests that return dicts, so here we - # force the Python 2 style dict printing - import IPython.lib.pretty - IPython.lib.pretty.DICT_IS_ORDERED = False -- ++ # insertion order, which is preserved in those versions). ++ # However, this order is random in some instances. ++ # Also modifications of code may affect the order. ++ # So here we fore sorted dict printing. ++ IPython.lib.pretty.for_type(dict, _sorted_dict_pprinter_factory('{', '}')) + # Switch on extra debugging from sage.structure.debug_options import debug - debug.refine_category_hash_check = True -diff --git a/src/sage/doctest/util.py b/src/sage/doctest/util.py -index cd1706e011..c9613b5cf4 100644 ---- a/src/sage/doctest/util.py -+++ b/src/sage/doctest/util.py -@@ -77,7 +77,7 @@ def dict_difference(self, other): - sage: D1 = DocTestDefaults() - sage: D2 = DocTestDefaults(foobar="hello", timeout=100) - sage: dict_difference(D2.__dict__, D1.__dict__) -- {'foobar': 'hello', 'timeout': 100} -+ {'timeout': 100, 'foobar': 'hello'} - """ - D = dict() - for k, v in self.items(): -diff --git a/src/sage/ext/fast_callable.pyx b/src/sage/ext/fast_callable.pyx -index 94e2928525..cb461c07f8 100644 ---- a/src/sage/ext/fast_callable.pyx -+++ b/src/sage/ext/fast_callable.pyx -@@ -2020,11 +2020,11 @@ cdef class InstructionStream: - sage: instr_stream = InstructionStream(metadata, 1) - sage: instr_stream.get_current() - {'args': 1, -- 'code': [], - 'constants': [], -- 'domain': None, - 'py_constants': [], -- 'stack': 0} -+ 'stack': 0, -+ 'code': [], -+ 'domain': None} - sage: md = instr_stream.get_metadata() - sage: type(md) - <type 'sage.ext.fast_callable.InterpreterMetadata'> -@@ -2241,11 +2241,11 @@ cdef class InstructionStream: - sage: instr_stream = InstructionStream(metadata, 1) - sage: instr_stream.get_current() - {'args': 1, -- 'code': [], - 'constants': [], -- 'domain': None, - 'py_constants': [], -- 'stack': 0} -+ 'stack': 0, -+ 'code': [], -+ 'domain': None} - sage: instr_stream.instr('load_arg', 0) - sage: instr_stream.instr('py_call', math.sin, 1) - sage: instr_stream.instr('abs') -@@ -2254,11 +2254,11 @@ cdef class InstructionStream: - [('load_arg', 0), ('py_call', <built-in function sin>, 1), 'abs', 'return'] - sage: instr_stream.get_current() - {'args': 1, -- 'code': [0, 0, 3, 0, 1, 12, 2], - 'constants': [], -- 'domain': None, - 'py_constants': [<built-in function sin>], -- 'stack': 1} -+ 'stack': 1, -+ 'code': [0, 0, 3, 0, 1, 12, 2], -+ 'domain': None} - """ - d = {'args': self._n_args, - 'constants': self._constants, -@@ -2438,11 +2438,11 @@ cdef class Wrapper: - sage: v = Wrapper_py(instr_stream.get_current()) - sage: v.get_orig_args() - {'args': 1, -- 'code': [0, 0, 1, 0, 4, 0, 0, 1, 1, 4, 6, 2], - 'constants': [pi, 1], -- 'domain': None, - 'py_constants': [], -- 'stack': 3} -+ 'stack': 3, -+ 'code': [0, 0, 1, 0, 4, 0, 0, 1, 1, 4, 6, 2], -+ 'domain': None} - sage: v.op_list() - [('load_arg', 0), ('load_const', pi), 'add', ('load_arg', 0), ('load_const', 1), 'add', 'mul', 'return'] - """ -@@ -2465,11 +2465,11 @@ cdef class Wrapper: - - sage: fast_callable(sin(x)/x, vars=[x], domain=RDF).get_orig_args() - {'args': 1, -- 'code': [0, 0, 16, 0, 0, 8, 2], - 'constants': [], -- 'domain': Real Double Field, - 'py_constants': [], -- 'stack': 2} -+ 'stack': 2, -+ 'code': [0, 0, 16, 0, 0, 8, 2], -+ 'domain': Real Double Field} - """ - return self._orig_args - -diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py -index adafb48182..e042bab502 100644 ---- a/src/sage/geometry/polyhedron/base.py -+++ b/src/sage/geometry/polyhedron/base.py -@@ -6300,20 +6300,20 @@ class Polyhedron_base(Element): - sage: P = polytopes.twenty_four_cell() - sage: P.flag_f_vector() - {(-1,): 1, -- (0,): 24, -- (0, 1): 192, -- (0, 1, 2): 576, - (0, 1, 2, 3): 1152, -+ (0, 1, 2): 576, - (0, 1, 3): 576, -- (0, 2): 288, - (0, 2, 3): 576, -- (0, 3): 144, -- (1,): 96, -- (1, 2): 288, - (1, 2, 3): 576, -+ (0, 1): 192, -+ (0, 2): 288, -+ (1, 2): 288, -+ (0, 3): 144, - (1, 3): 288, -- (2,): 96, - (2, 3): 192, -+ (0,): 24, -+ (1,): 96, -+ (2,): 96, - (3,): 24, - (4,): 1} - -@@ -6343,18 +6343,18 @@ class Polyhedron_base(Element): - sage: P = (Polyhedron(lines=[[1]]) * polytopes.cross_polytope(3)) - sage: P.flag_f_vector() - {(-1,): 1, -- (0, 1): 0, - (0, 1, 2): 0, - (0, 1, 3): 0, -- (0, 2): 0, - (0, 2, 3): 0, -+ (1, 2, 3): 48, -+ (0, 1): 0, -+ (0, 2): 0, - (0, 3): 0, -- (0,): 0, - (1, 2): 24, -- (1, 2, 3): 48, - (1, 3): 24, -- (1,): 6, - (2, 3): 24, -+ (0,): 0, -+ (1,): 6, - (2,): 12, - (3,): 8, - 4: 1} -@@ -6394,22 +6394,22 @@ class Polyhedron_base(Element): - - sage: polytopes.hypercube(4)._flag_f_vector() - {(-1,): 1, -- (0,): 16, -- (0, 1): 64, -- (0, 1, 2): 192, -- (0, 1, 2, 3): 384, -- (0, 1, 3): 192, -- (0, 2): 96, -- (0, 2, 3): 192, -- (0, 3): 64, -- (1,): 32, -- (1, 2): 96, -- (1, 2, 3): 192, -- (1, 3): 96, -- (2,): 24, -- (2, 3): 48, -- (3,): 8, -- (4,): 1} -+ (0, 1, 2, 3): 384, -+ (0, 1, 2): 192, -+ (0, 1, 3): 192, -+ (0, 2, 3): 192, -+ (1, 2, 3): 192, -+ (0, 1): 64, -+ (0, 2): 96, -+ (1, 2): 96, -+ (0, 3): 64, -+ (1, 3): 96, -+ (2, 3): 48, -+ (0,): 16, -+ (1,): 32, -+ (2,): 24, -+ (3,): 8, -+ (4,): 1} - """ - return self.combinatorial_polyhedron()._flag_f_vector() - -diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx -index 870c733ea1..6dfdf2b254 100644 ---- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx -+++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx -@@ -1551,20 +1551,20 @@ cdef class CombinatorialPolyhedron(SageObject): - sage: C = polytopes.hypercube(4).combinatorial_polyhedron() - sage: C.flag_f_vector() - {(-1,): 1, -- (0,): 16, -- (0, 1): 64, -- (0, 1, 2): 192, - (0, 1, 2, 3): 384, -+ (0, 1, 2): 192, - (0, 1, 3): 192, -- (0, 2): 96, - (0, 2, 3): 192, -- (0, 3): 64, -- (1,): 32, -- (1, 2): 96, - (1, 2, 3): 192, -+ (0, 1): 64, -+ (0, 2): 96, -+ (1, 2): 96, -+ (0, 3): 64, - (1, 3): 96, -- (2,): 24, - (2, 3): 48, -+ (0,): 16, -+ (1,): 32, -+ (2,): 24, - (3,): 8, - (4,): 1} - -@@ -1593,7 +1593,7 @@ cdef class CombinatorialPolyhedron(SageObject): - - sage: C = (Polyhedron(lines=[[1]]) * polytopes.hypercube(2)).combinatorial_polyhedron() - sage: C.flag_f_vector() -- {(-1,): 1, (0, 1): 0, (0, 2): 0, (0,): 0, (1, 2): 8, (1,): 4, (2,): 4, 3: 1} -+ {(-1,): 1, (0, 1): 0, (0, 2): 0, (1, 2): 8, (0,): 0, (1,): 4, (2,): 4, 3: 1} - - If the arguments are not stricly increasing or out of range, a key error is raised:: - -@@ -1630,7 +1630,7 @@ cdef class CombinatorialPolyhedron(SageObject): - - sage: C = CombinatorialPolyhedron(3) - sage: C._flag_f_vector() -- {(-1,): 1, (0, 1): 0, (0, 2): 0, (0,): 0, (1, 2): 0, (1,): 0, (2,): 0, 3: 1} -+ {(-1,): 1, (0, 1): 0, (0, 2): 0, (1, 2): 0, (0,): 0, (1,): 0, (2,): 0, 3: 1} - """ - poly = self.face_lattice().flag_f_polynomial() - variables = poly.variables() -diff --git a/src/sage/geometry/polyhedron/ppl_lattice_polytope.py b/src/sage/geometry/polyhedron/ppl_lattice_polytope.py -index 4287f9ed56..78d30d8f75 100644 ---- a/src/sage/geometry/polyhedron/ppl_lattice_polytope.py -+++ b/src/sage/geometry/polyhedron/ppl_lattice_polytope.py -@@ -1229,15 +1229,15 @@ class LatticePolytope_PPL_class(C_Polyhedron): - sage: polygon.embed_in_reflexive_polytope('polytope') - A 2-dimensional lattice polytope in ZZ^2 with 3 vertices - sage: polygon.embed_in_reflexive_polytope('points') -- {(0, 0, 2, 1): (1, 0), -- (0, 1, 2, 0): (0, 1), -- (1, 0, 1, 2): (2, 0), -- (1, 1, 1, 1): (1, 1), -+ {(0, 1, 2, 0): (0, 1), - (1, 2, 1, 0): (0, 2), -- (2, 0, 0, 3): (3, 0), -- (2, 1, 0, 2): (2, 1), -+ (2, 3, 0, 0): (0, 3), -+ (0, 0, 2, 1): (1, 0), -+ (1, 1, 1, 1): (1, 1), - (2, 2, 0, 1): (1, 2), -- (2, 3, 0, 0): (0, 3)} -+ (1, 0, 1, 2): (2, 0), -+ (2, 1, 0, 2): (2, 1), -+ (2, 0, 0, 3): (3, 0)} - - sage: LatticePolytope_PPL((0,0), (4,0), (0,4)).embed_in_reflexive_polytope() - Traceback (most recent call last): -diff --git a/src/sage/geometry/triangulation/element.py b/src/sage/geometry/triangulation/element.py -index fe7a656094..7afd37e914 100644 ---- a/src/sage/geometry/triangulation/element.py -+++ b/src/sage/geometry/triangulation/element.py -@@ -603,32 +603,32 @@ class Triangulation(Element): - - sage: triangulation = polytopes.hypercube(2).triangulate(engine='internal') - sage: triangulation._boundary_simplex_dictionary() -- {(0, 1): ((0, 1, 3),), -+ {(1, 3): ((0, 1, 3), (1, 2, 3)), - (0, 3): ((0, 1, 3),), -- (1, 2): ((1, 2, 3),), -- (1, 3): ((0, 1, 3), (1, 2, 3)), -- (2, 3): ((1, 2, 3),)} -+ (0, 1): ((0, 1, 3),), -+ (2, 3): ((1, 2, 3),), -+ (1, 2): ((1, 2, 3),)} - - sage: triangulation = polytopes.cube().triangulate(engine='internal') - sage: triangulation._boundary_simplex_dictionary() -- {(0, 1, 2): ((0, 1, 2, 7),), -- (0, 1, 5): ((0, 1, 5, 7),), -- (0, 1, 7): ((0, 1, 2, 7), (0, 1, 5, 7)), -- (0, 2, 3): ((0, 2, 3, 7),), -+ {(1, 2, 7): ((0, 1, 2, 7),), - (0, 2, 7): ((0, 1, 2, 7), (0, 2, 3, 7)), -- (0, 3, 4): ((0, 3, 4, 7),), -- (0, 3, 7): ((0, 2, 3, 7), (0, 3, 4, 7)), -- (0, 4, 5): ((0, 4, 5, 7),), -- (0, 4, 7): ((0, 3, 4, 7), (0, 4, 5, 7)), -- (0, 5, 7): ((0, 1, 5, 7), (0, 4, 5, 7)), -- (1, 2, 7): ((0, 1, 2, 7),), -- (1, 5, 6): ((1, 5, 6, 7),), -+ (0, 1, 7): ((0, 1, 2, 7), (0, 1, 5, 7)), -+ (0, 1, 2): ((0, 1, 2, 7),), - (1, 5, 7): ((0, 1, 5, 7), (1, 5, 6, 7)), -- (1, 6, 7): ((1, 5, 6, 7),), -+ (0, 5, 7): ((0, 1, 5, 7), (0, 4, 5, 7)), -+ (0, 1, 5): ((0, 1, 5, 7),), - (2, 3, 7): ((0, 2, 3, 7),), -+ (0, 3, 7): ((0, 2, 3, 7), (0, 3, 4, 7)), -+ (0, 2, 3): ((0, 2, 3, 7),), - (3, 4, 7): ((0, 3, 4, 7),), -+ (0, 4, 7): ((0, 3, 4, 7), (0, 4, 5, 7)), -+ (0, 3, 4): ((0, 3, 4, 7),), - (4, 5, 7): ((0, 4, 5, 7),), -- (5, 6, 7): ((1, 5, 6, 7),)} -+ (0, 4, 5): ((0, 4, 5, 7),), -+ (5, 6, 7): ((1, 5, 6, 7),), -+ (1, 6, 7): ((1, 5, 6, 7),), -+ (1, 5, 6): ((1, 5, 6, 7),)} - """ - result = dict() - for simplex in self: -@@ -748,12 +748,10 @@ class Triangulation(Element): - (-1, 0, 0, -1), - ( 0, 1, 0, -1), - ( 0, -1, 0, 1) -- in Ambient free module of rank 4 -- over the principal ideal domain Integer Ring -+ in Ambient free module of rank 4 over the principal ideal domain Integer Ring - sage: N.dual().rays() - (1, -1, 1, -1) -- in Ambient free module of rank 4 -- over the principal ideal domain Integer Ring -+ in Ambient free module of rank 4 over the principal ideal domain Integer Ring - - TESTS:: - -diff --git a/src/sage/graphs/base/boost_graph.pyx b/src/sage/graphs/base/boost_graph.pyx -index 6ba0a44c9a..c50374c542 100644 ---- a/src/sage/graphs/base/boost_graph.pyx -+++ b/src/sage/graphs/base/boost_graph.pyx -@@ -1137,10 +1137,10 @@ cpdef johnson_shortest_paths(g, weight_function=None, distances=True, predecesso - 3: {3: 0}} - sage: g = DiGraph([(1,2,3),(2,3,2),(1,4,1),(4,2,1)], weighted=True) - sage: johnson_shortest_paths(g, distances=False, predecessors=True) -- {1: {1: None, 2: 4, 3: 2, 4: 1}, -+ {1: {1: None, 4: 1, 3: 2, 2: 4}, - 2: {2: None, 3: 2}, - 3: {3: None}, -- 4: {2: 4, 3: 2, 4: None}} -+ 4: {4: None, 3: 2, 2: 4}} - - TESTS: - -@@ -1292,10 +1292,10 @@ cpdef floyd_warshall_shortest_paths(g, weight_function=None, distances=True, pre - 3: {3: 0}} - sage: g = DiGraph([(1,2,3),(2,3,2),(1,4,1),(4,2,1)], weighted=True) - sage: floyd_warshall_shortest_paths(g, distances=False, predecessors=True) -- {1: {1: None, 2: 4, 3: 2, 4: 1}, -+ {1: {1: None, 4: 1, 3: 2, 2: 4}, - 2: {2: None, 3: 2}, - 3: {3: None}, -- 4: {2: 4, 3: 2, 4: None}} -+ 4: {4: None, 3: 2, 2: 4}} - - TESTS: - -diff --git a/src/sage/graphs/base/c_graph.pyx b/src/sage/graphs/base/c_graph.pyx -index d9eb17d98e..453c0302a6 100644 ---- a/src/sage/graphs/base/c_graph.pyx -+++ b/src/sage/graphs/base/c_graph.pyx -@@ -2890,7 +2890,7 @@ cdef class CGraphBackend(GenericGraphBackend): - sage: all((not paths[v] or len(paths[v])-1 == g.distance(0,v)) for v in g) - True - sage: g._backend.shortest_path_all_vertices(0, distance_flag=True) -- {0: 0, 1: 1, 2: 2, 3: 2, 4: 1, 5: 1, 6: 2, 7: 2, 8: 2, 9: 2} -+ {0: 0, 5: 1, 4: 1, 1: 1, 6: 2, 2: 2, 9: 2, 3: 2, 8: 2, 7: 2} - - On a disconnected graph :: - -diff --git a/src/sage/graphs/centrality.pyx b/src/sage/graphs/centrality.pyx -index cd69e1628a..acb5489824 100755 ---- a/src/sage/graphs/centrality.pyx -+++ b/src/sage/graphs/centrality.pyx -@@ -855,16 +855,16 @@ def centrality_closeness_random_k(G, int k=1): - sage: from sage.graphs.centrality import centrality_closeness_random_k - sage: G = graphs.PetersenGraph() - sage: centrality_closeness_random_k(G, 10) -- {0: 0.6, -- 1: 0.6, -- 2: 0.6, -- 3: 0.6, -- 4: 0.6, -- 5: 0.6, -- 6: 0.6, -- 7: 0.6, -- 8: 0.6, -- 9: 0.6} -+ {...: 0.6, -+ ...: 0.6, -+ ...: 0.6, -+ ...: 0.6, -+ ...: 0.6, -+ ...: 0.6, -+ ...: 0.6, -+ ...: 0.6, -+ ...: 0.6, -+ ...: 0.6} - - TESTS:: - -diff --git a/src/sage/graphs/digraph.py b/src/sage/graphs/digraph.py -index e6275fa389..c6c405fac0 100644 ---- a/src/sage/graphs/digraph.py -+++ b/src/sage/graphs/digraph.py -@@ -3212,7 +3212,7 @@ class DiGraph(GenericGraph): - installed, so we don't test its relative values:: - - sage: H.layout_acyclic() -- {0: [..., ...], 1: [..., ...], 2: [..., ...], 3: [..., ...], 5: [..., ...], 6: [..., ...]} -+ {0: [..., ...], 5: [..., ...], 1: [..., ...], 6: [..., ...], 2: [..., ...], 3: [..., ...]} - - sage: H = DiGraph({0: [1]}) - sage: pos = H.layout_acyclic(rankdir='up') -@@ -3257,15 +3257,15 @@ class DiGraph(GenericGraph): - - sage: H = DiGraph({0: [1, 2], 1: [3], 2: [3], 3: [], 5: [1, 6], 6: [2, 3]}) - sage: H.layout_acyclic_dummy() -- {0: [1.00..., 0], 1: [1.00..., 1], 2: [1.51..., 2], 3: [1.50..., 3], 5: [2.01..., 0], 6: [2.00..., 1]} -+ {0: [1.00..., 0], 5: [2.01..., 0], 1: [1.00..., 1], 6: [2.00..., 1], 2: [1.51..., 2], 3: [1.50..., 3]} - - sage: H = DiGraph({0: [1]}) - sage: H.layout_acyclic_dummy(rankdir='up') - {0: [0.5..., 0], 1: [0.5..., 1]} - sage: H.layout_acyclic_dummy(rankdir='down') -- {0: [0.5..., 1], 1: [0.5..., 0]} -+ {1: [0.5..., 0], 0: [0.5..., 1]} - sage: H.layout_acyclic_dummy(rankdir='left') -- {0: [1, 0.5...], 1: [0, 0.5...]} -+ {1: [0, 0.5...], 0: [1, 0.5...]} - sage: H.layout_acyclic_dummy(rankdir='right') - {0: [0, 0.5...], 1: [1, 0.5...]} - sage: H = DiGraph({0: [1, 2], 1: [3], 2: [3], 3: [1], 5: [1, 6], 6: [2, 3]}) -diff --git a/src/sage/graphs/distances_all_pairs.pyx b/src/sage/graphs/distances_all_pairs.pyx -index 802d4a8f6e..aa5efb8dac 100644 ---- a/src/sage/graphs/distances_all_pairs.pyx -+++ b/src/sage/graphs/distances_all_pairs.pyx -@@ -1548,7 +1548,7 @@ def distances_distribution(G): - sage: g = graphs.PetersenGraph() - sage: g.add_edge('good','wine') - sage: g.distances_distribution() -- {1: 8/33, 2: 5/11, +Infinity: 10/33} -+ {1: 8/33, +Infinity: 10/33, 2: 5/11} - - The de Bruijn digraph dB(2,3):: - -@@ -1673,9 +1673,9 @@ def floyd_warshall(gg, paths=True, distances=False): - sage: g = graphs.DiamondGraph() - sage: floyd_warshall(g, paths=False, distances=True) - {0: {0: 0, 1: 1, 2: 1, 3: 2}, -- 1: {0: 1, 1: 0, 2: 1, 3: 1}, -- 2: {0: 1, 1: 1, 2: 0, 3: 1}, -- 3: {0: 2, 1: 1, 2: 1, 3: 0}} -+ 1: {1: 0, 0: 1, 2: 1, 3: 1}, -+ 2: {2: 0, 0: 1, 1: 1, 3: 1}, -+ 3: {3: 0, 0: 2, 1: 1, 2: 1}} - - TESTS: - -diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py -index 8779f53b5a..45452c29d9 100644 ---- a/src/sage/graphs/generic_graph.py -+++ b/src/sage/graphs/generic_graph.py -@@ -5202,7 +5202,7 @@ class GenericGraph(GenericGraph_pyx): - This method is deprecated since Sage-4.4.1.alpha2. Please use instead: - - sage: g.layout(layout = "planar", save_pos = True) -- {0: [1, 4], 1: [5, 1], 2: [0, 5], 3: [1, 0], 4: [1, 2], 5: [2, 1], 6: [4, 1]} -+ {1: [5, 1], 2: [0, 5], 3: [1, 0], 0: [1, 4], 4: [1, 2], 5: [2, 1], 6: [4, 1]} - """ - deprecation(24494, 'This method is replaced by the method layout. ' - 'Please use layout(layout="planar", save_pos=True) ' -@@ -5256,16 +5256,16 @@ class GenericGraph(GenericGraph_pyx): - - sage: g = graphs.PathGraph(10) - sage: g.layout(layout='planar', save_pos=True, test=True) -- {0: [3, 2], -+ {5: [8, 1], -+ 7: [0, 8], -+ 9: [1, 0], -+ 0: [3, 2], - 1: [4, 3], - 2: [3, 4], - 3: [4, 4], - 4: [2, 6], -- 5: [8, 1], - 6: [1, 7], -- 7: [0, 8], -- 8: [1, 1], -- 9: [1, 0]} -+ 8: [1, 1]} - sage: g = graphs.BalancedTree(3, 4) - sage: pos = g.layout(layout='planar', save_pos=True, test=True) - sage: pos[0] -@@ -5274,7 +5274,7 @@ class GenericGraph(GenericGraph_pyx): - [3, 64] - sage: g = graphs.CycleGraph(7) - sage: g.layout(layout='planar', save_pos=True, test=True) -- {0: [1, 4], 1: [5, 1], 2: [0, 5], 3: [1, 0], 4: [1, 2], 5: [2, 1], 6: [4, 1]} -+ {1: [5, 1], 2: [0, 5], 3: [1, 0], 0: [1, 4], 4: [1, 2], 5: [2, 1], 6: [4, 1]} - sage: g = graphs.CompleteGraph(5) - sage: g.layout(layout='planar', save_pos=True, test=True, set_embedding=True) - Traceback (most recent call last): -@@ -5285,9 +5285,9 @@ class GenericGraph(GenericGraph_pyx): - - sage: g = graphs.CompleteGraph(4) - sage: g.layout(layout='planar', external_face=(0,1)) -- {0: [0, 2], 1: [2, 1], 2: [1, 0], 3: [1, 1]} -+ {1: [2, 1], 0: [0, 2], 2: [1, 0], 3: [1, 1]} - sage: g.layout(layout='planar', external_face=(3,1)) -- {0: [2, 1], 1: [0, 2], 2: [1, 1], 3: [1, 0]} -+ {0: [2, 1], 1: [0, 2], 3: [1, 0], 2: [1, 1]} - - Choose the embedding: - -@@ -16063,7 +16063,26 @@ class GenericGraph(GenericGraph_pyx): - - sage: D = graphs.DodecahedralGraph() - sage: D.shortest_paths(0) -- {0: [0], 1: [0, 1], 2: [0, 1, 2], 3: [0, 19, 3], 4: [0, 19, 3, 4], 5: [0, 1, 2, 6, 5], 6: [0, 1, 2, 6], 7: [0, 1, 8, 7], 8: [0, 1, 8], 9: [0, 10, 9], 10: [0, 10], 11: [0, 10, 11], 12: [0, 10, 11, 12], 13: [0, 10, 9, 13], 14: [0, 1, 8, 7, 14], 15: [0, 19, 18, 17, 16, 15], 16: [0, 19, 18, 17, 16], 17: [0, 19, 18, 17], 18: [0, 19, 18], 19: [0, 19]} -+ {0: [0], -+ 10: [0, 10], -+ 19: [0, 19], -+ 1: [0, 1], -+ 8: [0, 1, 8], -+ 2: [0, 1, 2], -+ 3: [0, 19, 3], -+ 18: [0, 19, 18], -+ 11: [0, 10, 11], -+ 9: [0, 10, 9], -+ 13: [0, 10, 9, 13], -+ 12: [0, 10, 11, 12], -+ 17: [0, 19, 18, 17], -+ 4: [0, 19, 3, 4], -+ 6: [0, 1, 2, 6], -+ 7: [0, 1, 8, 7], -+ 14: [0, 1, 8, 7, 14], -+ 5: [0, 1, 2, 6, 5], -+ 16: [0, 19, 18, 17, 16], -+ 15: [0, 19, 18, 17, 16, 15]} - - All these paths are obviously induced graphs:: - -@@ -16073,7 +16092,16 @@ class GenericGraph(GenericGraph_pyx): - :: - - sage: D.shortest_paths(0, cutoff=2) -- {0: [0], 1: [0, 1], 2: [0, 1, 2], 3: [0, 19, 3], 8: [0, 1, 8], 9: [0, 10, 9], 10: [0, 10], 11: [0, 10, 11], 18: [0, 19, 18], 19: [0, 19]} -+ {0: [0], -+ 10: [0, 10], -+ 19: [0, 19], -+ 1: [0, 1], -+ 8: [0, 1, 8], -+ 2: [0, 1, 2], -+ 3: [0, 19, 3], -+ 18: [0, 19, 18], -+ 11: [0, 10, 11], -+ 9: [0, 10, 9]} - sage: G = Graph( { 0: {1: 1}, 1: {2: 1}, 2: {3: 1}, 3: {4: 2}, 4: {0: 2} }, sparse=True) - sage: G.plot(edge_labels=True).show() # long time - sage: G.shortest_paths(0, by_weight=True) -@@ -16083,7 +16111,7 @@ class GenericGraph(GenericGraph_pyx): - - sage: D = DiGraph([(0,1,1),(1,2,3),(0,2,5)]) - sage: D.shortest_paths(0) -- {0: [0], 1: [0, 1], 2: [0, 2]} -+ {0: [0], 2: [0, 2], 1: [0, 1]} - sage: D.shortest_paths(0, by_weight=True) - {0: [0], 1: [0, 1], 2: [0, 1, 2]} - -@@ -16332,7 +16360,26 @@ class GenericGraph(GenericGraph_pyx): - - sage: D = graphs.DodecahedralGraph() - sage: D.shortest_path_lengths(0) -- {0: 0, 1: 1, 2: 2, 3: 2, 4: 3, 5: 4, 6: 3, 7: 3, 8: 2, 9: 2, 10: 1, 11: 2, 12: 3, 13: 3, 14: 4, 15: 5, 16: 4, 17: 3, 18: 2, 19: 1} -+ {0: 0, -+ 10: 1, -+ 19: 1, -+ 1: 1, -+ 8: 2, -+ 2: 2, -+ 3: 2, -+ 18: 2, -+ 11: 2, -+ 9: 2, -+ 13: 3, -+ 12: 3, -+ 17: 3, -+ 4: 3, -+ 6: 3, -+ 7: 3, -+ 14: 4, -+ 5: 4, -+ 16: 4, -+ 15: 5} - - Weighted case:: - -@@ -18450,18 +18497,18 @@ class GenericGraph(GenericGraph_pyx): - '#00ff00': [((1,3,2,4), (1,4)(2,3), 3), ...], - '#ff0000': [((1,3,2,4), (1,3)(2,4), 1), ...]} - sage: G._color_by_label() # py3 -- {'#0000ff': [((), (1,2), 1), ...], -+ {'#ff0000': [((), (2,3), 2), ...], - '#00ff00': [((), (3,4), 3), ...], -- '#ff0000': [((), (2,3), 2), ...]} -+ '#0000ff': [((), (1,2), 1), ...]} - - sage: G._color_by_label({1: "blue", 2: "red", 3: "green"}) # py2 - {'blue': [((1,3,2,4), (1,3)(2,4), 1), ...], - 'green': [((1,3,2,4), (1,4)(2,3), 3), ...], - 'red': [((1,3,2,4), (1,2,4), 2), ...]} - sage: G._color_by_label({1: "blue", 2: "red", 3: "green"}) # py3 -- {'blue': [((), (1,2), 1), ...], -+ {'red': [((), (2,3), 2), ...], - 'green': [((), (3,4), 3), ...], -- 'red': [((), (2,3), 2), ...]} -+ 'blue': [((), (1,2), 1), ...]} - - TESTS: - -@@ -18606,8 +18653,8 @@ class GenericGraph(GenericGraph_pyx): - - sage: g.layout(layout="acyclic_dummy", save_pos=True) - {('0', 0): [0.3..., 0], -- ('0', 1): [0.3..., 1], - ('1', 0): [0.6..., 0], -+ ('0', 1): [0.3..., 1], - ('1', 1): [0.6..., 1]} - - sage: D3 = g.layout(dim=3); D3 # random -@@ -18743,10 +18790,10 @@ class GenericGraph(GenericGraph_pyx): - sage: g = graphs.LadderGraph(3) - sage: g.layout_ranked(heights={i: (i, i+3) for i in range(3)}) - {0: [0.668..., 0], -- 1: [0.667..., 1], -- 2: [0.677..., 2], - 3: [1.34..., 0], -+ 1: [0.667..., 1], - 4: [1.33..., 1], -+ 2: [0.677..., 2], - 5: [1.33..., 2]} - sage: g = graphs.LadderGraph(7) - sage: g.plot(layout="ranked", heights={i: (i, i+7) for i in range(7)}) -@@ -18930,13 +18977,13 @@ class GenericGraph(GenericGraph_pyx): - - sage: G = graphs.BalancedTree(2, 2) - sage: G.layout_tree(tree_root=0) -- {0: (1.5, 0), -- 1: (2.5, -1), -+ {6: (0.0, -2), -+ 5: (1.0, -2), - 2: (0.5, -1), -- 3: (3.0, -2), - 4: (2.0, -2), -- 5: (1.0, -2), -- 6: (0.0, -2)} -+ 3: (3.0, -2), -+ 1: (2.5, -1), -+ 0: (1.5, 0)} - - sage: G = graphs.BalancedTree(2, 4) - sage: G.plot(layout="tree", tree_root=0, tree_orientation="up") -@@ -18948,15 +18995,15 @@ class GenericGraph(GenericGraph_pyx): - sage: T.set_embedding({0: [1, 6, 3], 1: [2, 5, 0], 2: [1], 3: [4, 7, 8, 0], - ....: 4: [3], 5: [1], 6: [0], 7: [3], 8: [3]}) - sage: T.layout_tree() -- {0: (2.166..., 0), -- 1: (3.5, -1), -- 2: (4.0, -2), -- 3: (1.0, -1), -+ {8: (0.0, -2), -+ 7: (1.0, -2), - 4: (2.0, -2), -- 5: (3.0, -2), -+ 3: (1.0, -1), - 6: (2.0, -1), -- 7: (1.0, -2), -- 8: (0.0, -2)} -+ 5: (3.0, -2), -+ 2: (4.0, -2), -+ 1: (3.5, -1), -+ 0: (2.166..., 0)} - sage: T.plot(layout="tree", tree_root=3) - Graphics object consisting of 18 graphics primitives - -@@ -23110,7 +23157,8 @@ class GenericGraph(GenericGraph_pyx): - - sage: G = DiGraph({1: [10], 2:[10,11], 3:[10,11], 4:[], 5:[11, 4], 6:[11], 7:[10,11], 8:[10,11], 9:[10], 10:[11, 5, 8], 11:[6]}) - sage: G.katz_centrality(.85) -- {1: 0.000000000000000, -+ {10: 20.9819819819820, -+ 1: 0.000000000000000, - 2: 0.000000000000000, - 3: 0.000000000000000, - 4: 16.7319819819820, -@@ -23119,7 +23167,6 @@ class GenericGraph(GenericGraph_pyx): - 7: 0.000000000000000, - 8: 18.6846846846847, - 9: 0.000000000000000, -- 10: 20.9819819819820, - 11: 202.778914049184} - - -@@ -23139,7 +23186,7 @@ class GenericGraph(GenericGraph_pyx): - sage: graphs.PathGraph(4).katz_centrality(1/20,3) - 21/379 - sage: (graphs.PathGraph(3) + graphs.PathGraph(4)).katz_centrality(1/20) -- {0: 11/199, 1: 21/199, 2: 11/199, 3: 21/379, 4: 41/379, 5: 41/379, 6: 21/379} -+ {3: 21/379, 4: 41/379, 5: 41/379, 6: 21/379, 0: 11/199, 1: 21/199, 2: 11/199} - - """ - n = self.order() -diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py -index 97321a3b74..8393015aaf 100644 ---- a/src/sage/graphs/graph.py -+++ b/src/sage/graphs/graph.py -@@ -3818,7 +3818,7 @@ class Graph(GenericGraph): - EXAMPLES:: - - sage: graphs.CycleGraph(4).bipartite_color() -- {0: 1, 1: 0, 2: 1, 3: 0} -+ {0: 1, 1: 0, 3: 0, 2: 1} - sage: graphs.CycleGraph(5).bipartite_color() - Traceback (most recent call last): - ... -@@ -4101,10 +4101,10 @@ class Graph(GenericGraph): - sage: G.plot(partition=P) - Graphics object consisting of 16 graphics primitives - sage: G.coloring(hex_colors=True, algorithm="MILP") -- {'#0000ff': [4], '#00ff00': [0, 6, 5], '#ff0000': [2, 1, 3]} -+ {'#ff0000': [2, 1, 3], '#00ff00': [0, 6, 5], '#0000ff': [4]} - sage: H = G.coloring(hex_colors=True, algorithm="DLX") - sage: H -- {'#0000ff': [4], '#00ff00': [1, 2, 3], '#ff0000': [0, 5, 6]} -+ {'#ff0000': [0, 5, 6], '#00ff00': [1, 2, 3], '#0000ff': [4]} - sage: G.plot(vertex_colors=H) - Graphics object consisting of 16 graphics primitives - -diff --git a/src/sage/graphs/graph_coloring.pyx b/src/sage/graphs/graph_coloring.pyx -index 7f82c45712..f45111c24a 100644 ---- a/src/sage/graphs/graph_coloring.pyx -+++ b/src/sage/graphs/graph_coloring.pyx -@@ -1029,10 +1029,10 @@ def edge_coloring(g, value_only=False, vizing=False, hex_colors=False, solver=No - [(0, 5), (2, 7)], - [(1, 6), (3, 4), (5, 8), (7, 9)]] - sage: edge_coloring(g, value_only=False, hex_colors=True, solver='GLPK') -- {'#00ffff': [(0, 5), (2, 7)], -- '#7f00ff': [(1, 6), (3, 4), (5, 8), (7, 9)], -+ {'#ff0000': [(0, 1), (2, 3), (4, 9), (5, 7), (6, 8)], - '#7fff00': [(0, 4), (1, 2), (3, 8), (6, 9)], -- '#ff0000': [(0, 1), (2, 3), (4, 9), (5, 7), (6, 8)]} -+ '#00ffff': [(0, 5), (2, 7)], -+ '#7f00ff': [(1, 6), (3, 4), (5, 8), (7, 9)]} - - Complete graphs are colored using the linear-time round-robin coloring:: - -diff --git a/src/sage/graphs/graph_database.py b/src/sage/graphs/graph_database.py -index a14cc59540..2334df7f2d 100644 ---- a/src/sage/graphs/graph_database.py -+++ b/src/sage/graphs/graph_database.py -@@ -742,177 +742,177 @@ class GraphDatabase(SQLDatabase): - - sage: G = GraphDatabase() - sage: G.get_skeleton() -- {u'aut_grp': {u'aut_grp_size': {'index': True, -+ {'degrees': {'graph_id': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': False, - 'unique': False}, -- u'edge_transitive': {'index': True, -+ 'degree_sequence': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'BOOLEAN', -+ 'index': False, - 'unique': False}, -- u'graph_id': {'index': False, -+ 'min_degree': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'num_fixed_points': {'index': True, -+ 'max_degree': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'num_orbits': {'index': True, -+ 'average_degree': {'sql': 'REAL', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'vertex_transitive': {'index': True, -+ 'degrees_sd': {'sql': 'REAL', - 'primary_key': False, -- 'sql': u'BOOLEAN', -- 'unique': False}}, -- u'degrees': {u'average_degree': {'index': True, -- 'primary_key': False, -- 'sql': u'REAL', -+ 'index': True, - 'unique': False}, -- u'degree_sequence': {'index': False, -+ 'regular': {'sql': 'BOOLEAN', -+ 'primary_key': False, -+ 'index': True, -+ 'unique': False}}, -+ 'spectrum': {'graph_id': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': False, - 'unique': False}, -- u'degrees_sd': {'index': True, -+ 'spectrum': {'sql': 'TEXT', - 'primary_key': False, -- 'sql': u'REAL', -+ 'index': False, - 'unique': False}, -- u'graph_id': {'index': False, -+ 'min_eigenvalue': {'sql': 'REAL', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'max_degree': {'index': True, -+ 'max_eigenvalue': {'sql': 'REAL', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'min_degree': {'index': True, -+ 'eigenvalues_sd': {'sql': 'REAL', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'regular': {'index': True, -+ 'energy': {'sql': 'REAL', - 'primary_key': False, -- 'sql': u'BOOLEAN', -+ 'index': True, - 'unique': False}}, -- u'graph_data': {u'complement_graph6': {'index': True, -+ 'aut_grp': {'graph_id': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'TEXT', -+ 'index': False, - 'unique': False}, -- u'eulerian': {'index': True, -+ 'aut_grp_size': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'BOOLEAN', -+ 'index': True, - 'unique': False}, -- u'graph6': {'index': True, -+ 'num_orbits': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'TEXT', -+ 'index': True, - 'unique': False}, -- u'graph_id': {'index': True, -+ 'num_fixed_points': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -- 'unique': True}, -- u'lovasz_number': {'index': True, -- 'primary_key': False, -- 'sql': u'REAL', -+ 'index': True, - 'unique': False}, -- u'num_cycles': {'index': True, -+ 'vertex_transitive': {'sql': 'BOOLEAN', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'num_edges': {'index': True, -+ 'edge_transitive': {'sql': 'BOOLEAN', - 'primary_key': False, -- 'sql': u'INTEGER', -- 'unique': False}, -- u'num_hamiltonian_cycles': {'index': True, -+ 'index': True, -+ 'unique': False}}, -+ 'misc': {'graph_id': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': False, - 'unique': False}, -- u'num_vertices': {'index': True, -+ 'vertex_connectivity': {'sql': 'BOOLEAN', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'perfect': {'index': True, -+ 'edge_connectivity': {'sql': 'BOOLEAN', - 'primary_key': False, -- 'sql': u'BOOLEAN', -+ 'index': True, - 'unique': False}, -- u'planar': {'index': True, -+ 'num_components': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'BOOLEAN', -- 'unique': False}}, -- u'misc': {u'clique_number': {'index': True, -- 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'diameter': {'index': True, -+ 'girth': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'edge_connectivity': {'index': True, -+ 'radius': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'BOOLEAN', -+ 'index': True, - 'unique': False}, -- u'girth': {'index': True, -+ 'diameter': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'graph_id': {'index': False, -+ 'clique_number': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'independence_number': {'index': True, -+ 'independence_number': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'induced_subgraphs': {'index': True, -+ 'num_cut_vertices': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'TEXT', -+ 'index': True, - 'unique': False}, -- u'min_vertex_cover_size': {'index': True, -+ 'min_vertex_cover_size': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'num_components': {'index': True, -+ 'num_spanning_trees': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'num_cut_vertices': {'index': True, -+ 'induced_subgraphs': {'sql': 'TEXT', -+ 'primary_key': False, -+ 'index': True, -+ 'unique': False}}, -+ 'graph_data': {'graph_id': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, -+ 'unique': True}, -+ 'graph6': {'sql': 'TEXT', -+ 'primary_key': False, -+ 'index': True, - 'unique': False}, -- u'num_spanning_trees': {'index': True, -+ 'num_vertices': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'radius': {'index': True, -+ 'num_edges': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'vertex_connectivity': {'index': True, -+ 'num_cycles': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'BOOLEAN', -- 'unique': False}}, -- u'spectrum': {u'eigenvalues_sd': {'index': True, -+ 'index': True, -+ 'unique': False}, -+ 'num_hamiltonian_cycles': {'sql': 'INTEGER', - 'primary_key': False, -- 'sql': u'REAL', -+ 'index': True, - 'unique': False}, -- u'energy': {'index': True, -+ 'eulerian': {'sql': 'BOOLEAN', - 'primary_key': False, -- 'sql': u'REAL', -+ 'index': True, - 'unique': False}, -- u'graph_id': {'index': False, -+ 'planar': {'sql': 'BOOLEAN', - 'primary_key': False, -- 'sql': u'INTEGER', -+ 'index': True, - 'unique': False}, -- u'max_eigenvalue': {'index': True, -+ 'perfect': {'sql': 'BOOLEAN', - 'primary_key': False, -- 'sql': u'REAL', -+ 'index': True, - 'unique': False}, -- u'min_eigenvalue': {'index': True, -+ 'lovasz_number': {'sql': 'REAL', - 'primary_key': False, -- 'sql': u'REAL', -+ 'index': True, - 'unique': False}, -- u'spectrum': {'index': False, -+ 'complement_graph6': {'sql': 'TEXT', - 'primary_key': False, -- 'sql': u'TEXT', -+ 'index': True, - 'unique': False}}} - """ - SQLDatabase.__init__(self, dblocation) -diff --git a/src/sage/graphs/isgci.py b/src/sage/graphs/isgci.py -index ce6211aa10..1088050e91 100644 ---- a/src/sage/graphs/isgci.py -+++ b/src/sage/graphs/isgci.py -@@ -762,7 +762,7 @@ class GraphClasses(UniqueRepresentation): - sage: type(t) - <... 'list'> - sage: t[0] -- {'sub': 'gc_1', 'super': 'gc_2'} -+ {'super': 'gc_2', 'sub': 'gc_1'} - """ - self._get_ISGCI() - return self.inclusions() -@@ -779,13 +779,13 @@ class GraphClasses(UniqueRepresentation): - - sage: t = graph_classes.smallgraphs() - sage: t -- {'2C_4': Graph on 8 vertices, -- '2K_2': Graph on 4 vertices, -- '2K_3': Graph on 6 vertices, -- '2K_3 + e': Graph on 6 vertices, -- '2K_4': Graph on 8 vertices, -- '2P_3': Graph on 6 vertices, -- ... -+ {'A \\cup K_1': Graph on 7 vertices, -+ '\\co{A \\cup K_1}': Graph on 7 vertices, -+ 'gem \\cup K_1': Graph on 6 vertices, -+ '\\co{gem \\cup K_1}': Graph on 6 vertices, -+ 'co-fork \\cup K_1': Graph on 6 vertices, -+ '\\co{co-fork \\cup K_1}': Graph on 6 vertices, -+ ... - sage: t['fish'] - Graph on 6 vertices - """ -diff --git a/src/sage/graphs/partial_cube.py b/src/sage/graphs/partial_cube.py -index 7174a23662..a08c5fd2a0 100644 ---- a/src/sage/graphs/partial_cube.py -+++ b/src/sage/graphs/partial_cube.py -@@ -112,13 +112,13 @@ def breadth_first_level_search(G, start): - sage: H = digraphs.DeBruijn(3,2) - sage: list(sage.graphs.partial_cube.breadth_first_level_search(H, '00')) - [{'00': {'01', '02'}}, -- {'01': {'10', '11', '12'}, '02': {'20', '21', '22'}}, -- {'10': set(), -- '11': set(), -- '12': set(), -- '20': set(), -- '21': set(), -- '22': set()}] -+ {...'01': {'10', '11', '12'}...}, -+ {'...': set(), -+ '...': set(), -+ '...': set(), -+ '...': set(), -+ '...': set(), -+ '...': set()}] - - """ - neighbors = G.neighbor_out_iterator -diff --git a/src/sage/graphs/schnyder.py b/src/sage/graphs/schnyder.py -index 879cd0e0e8..1212a575cd 100644 ---- a/src/sage/graphs/schnyder.py -+++ b/src/sage/graphs/schnyder.py -@@ -493,7 +493,7 @@ def _compute_coordinates(g, x): - sage: r = _realizer(g, tn) - sage: _compute_coordinates(g,r) - sage: g.get_pos() -- {0: [0, 5], 1: [5, 1], 2: [1, 0], 3: [4, 1], 4: [1, 1], 5: [2, 2], 6: [1, 4]} -+ {1: [5, 1], 0: [0, 5], 2: [1, 0], 3: [4, 1], 4: [1, 1], 5: [2, 2], 6: [1, 4]} - """ - - tree_nodes, (v1, v2, v3) = x -diff --git a/src/sage/graphs/tutte_polynomial.py b/src/sage/graphs/tutte_polynomial.py -index 377d6b253b..a3fbad9dea 100644 ---- a/src/sage/graphs/tutte_polynomial.py -+++ b/src/sage/graphs/tutte_polynomial.py -@@ -387,7 +387,7 @@ class VertexOrder(EdgeSelection): - sage: A.order - [4, 6, 3, 2, 1, 7] - sage: A.inverse_order -- {1: 4, 2: 3, 3: 2, 4: 0, 6: 1, 7: 5} -+ {4: 0, 6: 1, 3: 2, 2: 3, 1: 4, 7: 5} - """ - self.order = list(order) - self.inverse_order = dict([reversed(_) for _ in enumerate(order)]) -diff --git a/src/sage/groups/perm_gps/cubegroup.py b/src/sage/groups/perm_gps/cubegroup.py -index 72c2c484c4..54b2b1485f 100644 ---- a/src/sage/groups/perm_gps/cubegroup.py -+++ b/src/sage/groups/perm_gps/cubegroup.py -@@ -690,12 +690,12 @@ class CubeGroup(PermutationGroup_generic): - sage: C.parse(facets) == g - True - sage: faces = C.faces("L"); faces -- {'back': [[33, 34, 6], [36, 0, 4], [38, 39, 1]], -+ {'right': [[25, 26, 27], [28, 0, 29], [30, 31, 32]], -+ 'left': [[11, 13, 16], [10, 0, 15], [9, 12, 14]], -+ 'up': [[17, 2, 3], [20, 0, 5], [22, 7, 8]], - 'down': [[40, 42, 43], [37, 0, 45], [35, 47, 48]], - 'front': [[41, 18, 19], [44, 0, 21], [46, 23, 24]], -- 'left': [[11, 13, 16], [10, 0, 15], [9, 12, 14]], -- 'right': [[25, 26, 27], [28, 0, 29], [30, 31, 32]], -- 'up': [[17, 2, 3], [20, 0, 5], [22, 7, 8]]} -+ 'back': [[33, 34, 6], [36, 0, 4], [38, 39, 1]]} - sage: C.parse(faces) == C.parse("L") - True - sage: C.parse("L' R2") == C.parse("L^(-1)*R^2") -diff --git a/src/sage/knots/link.py b/src/sage/knots/link.py -index 8d98039a30..cc796274dc 100644 ---- a/src/sage/knots/link.py -+++ b/src/sage/knots/link.py -@@ -750,47 +750,47 @@ class Link(SageObject): - sage: L = Link([[1, 3, 2, 4], [2, 3, 1, 4]]) - sage: tails, heads = L._directions_of_edges() - sage: tails -- {1: [2, 3, 1, 4], 2: [1, 3, 2, 4], 3: [1, 3, 2, 4], 4: [2, 3, 1, 4]} -+ {2: [1, 3, 2, 4], 1: [2, 3, 1, 4], 3: [1, 3, 2, 4], 4: [2, 3, 1, 4]} - sage: heads -- {1: [1, 3, 2, 4], 2: [2, 3, 1, 4], 3: [2, 3, 1, 4], 4: [1, 3, 2, 4]} -+ {2: [2, 3, 1, 4], 1: [1, 3, 2, 4], 3: [2, 3, 1, 4], 4: [1, 3, 2, 4]} - - :: - - sage: L = Link([[1,5,2,4], [5,3,6,2], [3,1,4,6]]) - sage: tails, heads = L._directions_of_edges() - sage: tails -- {1: [3, 1, 4, 6], -- 2: [1, 5, 2, 4], -+ {2: [1, 5, 2, 4], - 3: [5, 3, 6, 2], - 4: [3, 1, 4, 6], - 5: [1, 5, 2, 4], -- 6: [5, 3, 6, 2]} -+ 6: [5, 3, 6, 2], -+ 1: [3, 1, 4, 6]} - sage: heads -- {1: [1, 5, 2, 4], -- 2: [5, 3, 6, 2], -+ {2: [5, 3, 6, 2], - 3: [3, 1, 4, 6], - 4: [1, 5, 2, 4], - 5: [5, 3, 6, 2], -- 6: [3, 1, 4, 6]} -+ 6: [3, 1, 4, 6], -+ 1: [1, 5, 2, 4]} - - :: - - sage: L = Link([[1,2,3,3], [2,4,5,5], [4,1,7,7]]) - sage: tails, heads = L._directions_of_edges() - sage: tails -- {1: [4, 1, 7, 7], -+ {3: [1, 2, 3, 3], - 2: [1, 2, 3, 3], -- 3: [1, 2, 3, 3], -- 4: [2, 4, 5, 5], - 5: [2, 4, 5, 5], -- 7: [4, 1, 7, 7]} -+ 4: [2, 4, 5, 5], -+ 7: [4, 1, 7, 7], -+ 1: [4, 1, 7, 7]} - sage: heads -- {1: [1, 2, 3, 3], -+ {3: [1, 2, 3, 3], - 2: [2, 4, 5, 5], -- 3: [1, 2, 3, 3], -- 4: [4, 1, 7, 7], - 5: [2, 4, 5, 5], -- 7: [4, 1, 7, 7]} -+ 4: [4, 1, 7, 7], -+ 7: [4, 1, 7, 7], -+ 1: [1, 2, 3, 3]} - """ - tails = {} - heads = {} -diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx -index 0698798c97..585b232ded 100644 ---- a/src/sage/libs/gap/element.pyx -+++ b/src/sage/libs/gap/element.pyx -@@ -3109,7 +3109,7 @@ cdef class GapElement_Record(GapElement): - We can easily convert a Gap ``rec`` object into a Python ``dict``:: - - sage: dict(rec) -- {'a': 123, 'b': 456} -+ {'b': 456, 'a': 123} - sage: type(_) - <... 'dict'> - -@@ -3217,15 +3217,15 @@ cdef class GapElement_Record(GapElement): - EXAMPLES:: - - sage: libgap.eval('rec(a:=1, b:=2)').sage() -- {'a': 1, 'b': 2} -+ {'b': 2, 'a': 1} - sage: all( isinstance(key,str) and val in ZZ for key,val in _.items() ) - True - - sage: rec = libgap.eval('rec(a:=123, b:=456, Sym3:=SymmetricGroup(3))') - sage: rec.sage() -- {'Sym3': NotImplementedError('cannot construct equivalent Sage object'...), -+ {'b': 456, - 'a': 123, -- 'b': 456} -+ 'Sym3': NotImplementedError('cannot construct equivalent Sage object'...)} - """ - result = {} - for key, val in self: -@@ -3254,7 +3254,7 @@ cdef class GapElement_RecordIterator(object): - sage: sorted(rec) - [('a', 123), ('b', 456)] - sage: dict(rec) -- {'a': 123, 'b': 456} -+ {'b': 456, 'a': 123} - """ - - def __cinit__(self, rec): -diff --git a/src/sage/libs/gap/libgap.pyx b/src/sage/libs/gap/libgap.pyx -index 3db0bbfded..cc29ba8053 100644 ---- a/src/sage/libs/gap/libgap.pyx -+++ b/src/sage/libs/gap/libgap.pyx -@@ -119,7 +119,7 @@ Or get them as results of computations:: - sage: rec['Sym3'] - Sym( [ 1 .. 3 ] ) - sage: dict(rec) -- {'Sym3': Sym( [ 1 .. 3 ] ), 'a': 123, 'b': 456} -+ {'b': 456, 'a': 123, 'Sym3': Sym( [ 1 .. 3 ] )} - - The output is a Sage dictionary whose keys are Sage strings and whose - Values are instances of :meth:`~sage.libs.gap.element.GapElement`. So, -@@ -128,9 +128,9 @@ convert the entries into Sage objects, you should use the - :meth:`~sage.libs.gap.element.GapElement.sage` method:: - - sage: rec.sage() -- {'Sym3': NotImplementedError('cannot construct equivalent Sage object'...), -+ {'b': 456, - 'a': 123, -- 'b': 456} -+ 'Sym3': NotImplementedError('cannot construct equivalent Sage object'...)} - - Now ``rec['a']`` is a Sage integer. We have not implemented the - conversion of the GAP symmetric group to the Sage symmetric group yet, -diff --git a/src/sage/libs/lrcalc/lrcalc.pyx b/src/sage/libs/lrcalc/lrcalc.pyx -index 1cf67dc15a..a3233c78cc 100644 ---- a/src/sage/libs/lrcalc/lrcalc.pyx -+++ b/src/sage/libs/lrcalc/lrcalc.pyx -@@ -27,19 +27,19 @@ Compute a product of Schur functions; return the coefficients in the - Schur expansion:: - - sage: lrcalc.mult([2,1], [2,1]) -- {[2, 2, 1, 1]: 1, -+ {[3, 3]: 1, -+ [4, 2]: 1, -+ [2, 2, 1, 1]: 1, - [2, 2, 2]: 1, -- [3, 1, 1, 1]: 1, - [3, 2, 1]: 2, -- [3, 3]: 1, - [4, 1, 1]: 1, -- [4, 2]: 1} -+ [3, 1, 1, 1]: 1} - - Same product, but include only partitions with at most 3 rows. This - corresponds to computing in the representation ring of gl(3):: - - sage: lrcalc.mult([2,1], [2,1], 3) -- {[2, 2, 2]: 1, [3, 2, 1]: 2, [3, 3]: 1, [4, 1, 1]: 1, [4, 2]: 1} -+ {[3, 3]: 1, [4, 2]: 1, [2, 2, 2]: 1, [3, 2, 1]: 2, [4, 1, 1]: 1} - - We can also compute the fusion product, here for sl(3) and level 2:: - -@@ -49,38 +49,38 @@ We can also compute the fusion product, here for sl(3) and level 2:: - Compute the expansion of a skew Schur function:: - - sage: lrcalc.skew([3,2,1],[2,1]) -- {[1, 1, 1]: 1, [2, 1]: 2, [3]: 1} -+ {[3]: 1, [2, 1]: 2, [1, 1, 1]: 1} - - Compute the coproduct of a Schur function:: - - sage: lrcalc.coprod([3,2,1]) -- {([1, 1, 1], [2, 1]): 1, -- ([2, 1], [2, 1]): 2, -- ([2, 1], [3]): 1, -- ([2, 1, 1], [1, 1]): 1, -- ([2, 1, 1], [2]): 1, -+ {([3, 1], [2]): 1, - ([2, 2], [1, 1]): 1, -- ([2, 2], [2]): 1, -- ([2, 2, 1], [1]): 1, - ([3, 1], [1, 1]): 1, -- ([3, 1], [2]): 1, -- ([3, 1, 1], [1]): 1, -+ ([2, 1], [3]): 1, -+ ([2, 1], [2, 1]): 2, -+ ([2, 2, 1], [1]): 1, -+ ([3, 2, 1], []): 1, - ([3, 2], [1]): 1, -- ([3, 2, 1], []): 1} -+ ([2, 1, 1], [2]): 1, -+ ([3, 1, 1], [1]): 1, -+ ([1, 1, 1], [2, 1]): 1, -+ ([2, 1, 1], [1, 1]): 1, -+ ([2, 2], [2]): 1} - - Multiply two Schubert polynomials:: - - sage: lrcalc.mult_schubert([4,2,1,3], [1,4,2,5,3]) -- {[4, 5, 1, 3, 2]: 1, -+ {[5, 4, 1, 2, 3]: 1, -+ [4, 5, 1, 3, 2]: 1, - [5, 3, 1, 4, 2]: 1, -- [5, 4, 1, 2, 3]: 1, - [6, 2, 1, 4, 3, 5]: 1} - - Same product, but include only permutations of 5 elements in the result. - This corresponds to computing in the cohomology ring of Fl(5):: - - sage: lrcalc.mult_schubert([4,2,1,3], [1,4,2,5,3], 5) -- {[4, 5, 1, 3, 2]: 1, [5, 3, 1, 4, 2]: 1, [5, 4, 1, 2, 3]: 1} -+ {[5, 4, 1, 2, 3]: 1, [4, 5, 1, 3, 2]: 1, [5, 3, 1, 4, 2]: 1} - - List all Littlewood-Richardson tableaux of skew shape `\mu/\nu`; in - this example `\mu=[3,2,1]` and `\nu=[2,1]`. Specifying a third entry -@@ -485,7 +485,7 @@ def mult(part1, part2, maxrows=None, level=None, quantum=None): - sage: mult([2,1],[3,2,1],3) - {[3, 3, 3]: 1, [4, 3, 2]: 2, [4, 4, 1]: 1, [5, 2, 2]: 1, [5, 3, 1]: 1} - sage: mult([2,1],[2,1],3,3) -- {[2, 2, 2]: 1, [3, 2, 1]: 2, [3, 3]: 1, [4, 1, 1]: 1} -+ {[3, 3]: 1, [2, 2, 2]: 1, [3, 2, 1]: 2, [4, 1, 1]: 1} - sage: mult([2,1],[2,1],None,3) - Traceback (most recent call last): - ... -diff --git a/src/sage/libs/ppl.pyx b/src/sage/libs/ppl.pyx -index 1b58f6eeb5..892d4afd1c 100644 ---- a/src/sage/libs/ppl.pyx -+++ b/src/sage/libs/ppl.pyx -@@ -2014,10 +2014,10 @@ cdef class Polyhedron(_mutable_or_immutable): - sage: p = C_Polyhedron(cs) - sage: p.maximize( x+y ) - {'bounded': True, -- 'generator': point(10/3, 0/3), -- 'maximum': True, -+ 'sup_n': 10, - 'sup_d': 3, -- 'sup_n': 10} -+ 'maximum': True, -+ 'generator': point(10/3, 0/3)} - - Unbounded case:: - -@@ -2028,10 +2028,10 @@ cdef class Polyhedron(_mutable_or_immutable): - {'bounded': False} - sage: p.maximize( -x ) - {'bounded': True, -- 'generator': closure_point(0/1), -- 'maximum': False, -+ 'sup_n': 0, - 'sup_d': 1, -- 'sup_n': 0} -+ 'maximum': False, -+ 'generator': closure_point(0/1)} - """ - cdef PPL_Coefficient sup_n - cdef PPL_Coefficient sup_d -@@ -2093,10 +2093,10 @@ cdef class Polyhedron(_mutable_or_immutable): - sage: p = C_Polyhedron(cs) - sage: p.minimize( x+y ) - {'bounded': True, -- 'generator': point(0/1, 0/1), -- 'inf_d': 1, - 'inf_n': 0, -- 'minimum': True} -+ 'inf_d': 1, -+ 'minimum': True, -+ 'generator': point(0/1, 0/1)} - - Unbounded case:: - -@@ -2105,10 +2105,10 @@ cdef class Polyhedron(_mutable_or_immutable): - sage: p = NNC_Polyhedron(cs) - sage: p.minimize( +x ) - {'bounded': True, -- 'generator': closure_point(0/1), -- 'inf_d': 1, - 'inf_n': 0, -- 'minimum': False} -+ 'inf_d': 1, -+ 'minimum': False, -+ 'generator': closure_point(0/1)} - sage: p.minimize( -x ) - {'bounded': False} - """ -diff --git a/src/sage/matroids/basis_exchange_matroid.pyx b/src/sage/matroids/basis_exchange_matroid.pyx -index fbe7be949a..bf9fc0e435 100644 ---- a/src/sage/matroids/basis_exchange_matroid.pyx -+++ b/src/sage/matroids/basis_exchange_matroid.pyx -@@ -2297,7 +2297,7 @@ cdef class BasisExchangeMatroid(Matroid): - sage: M1._is_isomorphic(M2) - True - sage: M1._is_isomorphic(M2, certificate=True) -- (True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4}) -+ (True, {4: 5, 0: 0, 2: 2, 1: 1, 3: 3, 5: 4}) - sage: M1 = BasisMatroid(matroids.named_matroids.Fano()) - sage: M2 = matroids.named_matroids.NonFano() - sage: M1._is_isomorphic(M2) -diff --git a/src/sage/matroids/catalog.py b/src/sage/matroids/catalog.py -index 845dd72e8e..83caf2d188 100644 ---- a/src/sage/matroids/catalog.py -+++ b/src/sage/matroids/catalog.py -@@ -724,7 +724,7 @@ def TernaryDowling3(): - sage: len(list(M.linear_subclasses())) - 72 - sage: M.fundamental_cycle('abc', 'd') -- {'a': 2, 'b': 1, 'd': 1} -+ {'d': 1, 'a': 2, 'b': 1} - - """ - A = Matrix(GF(3), [ -diff --git a/src/sage/matroids/circuit_closures_matroid.pyx b/src/sage/matroids/circuit_closures_matroid.pyx -index b46e32faa2..abd7194c03 100644 ---- a/src/sage/matroids/circuit_closures_matroid.pyx -+++ b/src/sage/matroids/circuit_closures_matroid.pyx -@@ -393,7 +393,7 @@ cdef class CircuitClosuresMatroid(Matroid): - sage: M1._is_isomorphic(M2) - True - sage: M1._is_isomorphic(M2, certificate=True) -- (True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4}) -+ (True, {4: 5, 0: 0, 5: 4, 1: 1, 3: 3, 2: 2}) - sage: M1 = CircuitClosuresMatroid(matroids.named_matroids.Fano()) - sage: M2 = matroids.named_matroids.NonFano() - sage: M1._is_isomorphic(M2) -diff --git a/src/sage/matroids/graphic_matroid.py b/src/sage/matroids/graphic_matroid.py -index 067753fb7f..389c2bb92f 100644 ---- a/src/sage/matroids/graphic_matroid.py -+++ b/src/sage/matroids/graphic_matroid.py -@@ -1058,7 +1058,7 @@ class GraphicMatroid(Matroid): - sage: M = Matroid(range(5), graphs.DiamondGraph()) - sage: N = Matroid(graph=graphs.DiamondGraph(), regular=True) - sage: M._is_isomorphic(N, certificate=True) -- (True, {0: (0, 1), 1: (0, 2), 2: (1, 2), 3: (1, 3), 4: (2, 3)}) -+ (True, {4: (2, 3), 2: (1, 2), 0: (0, 1), 1: (0, 2), 3: (1, 3)}) - sage: O = Matroid(graphs.WheelGraph(5)) - sage: M._is_isomorphic(O, certificate=True) - (False, None) -@@ -1081,7 +1081,7 @@ class GraphicMatroid(Matroid): - sage: M._is_isomorphic(N, certificate=True) - (True, {'a': 2, 'b': 4, 'c': 5, 'd': 0, 'e': 1, 'f': 3}) - sage: N._is_isomorphic(M, certificate=True) -- (True, {0: 'd', 1: 'e', 2: 'a', 3: 'f', 4: 'b', 5: 'c'}) -+ (True, {2: 'a', 4: 'b', 5: 'c', 0: 'd', 1: 'e', 3: 'f'}) - sage: O = Matroid(range(6), graphs.CycleGraph(6)) - sage: M._is_isomorphic(O) - False -@@ -1146,10 +1146,10 @@ class GraphicMatroid(Matroid): - sage: M2 = Matroid(range(4), graphs.CompleteBipartiteGraph(2,2)) - sage: M1._isomorphism(matroids.named_matroids.BetsyRoss()) - sage: M1._isomorphism(M2) -- {0: 0, 1: 1, 2: 2, 3: 3} -+ {3: 3, 0: 0, 1: 1, 2: 2} - sage: M3 = matroids.Uniform(3,4) - sage: M1._isomorphism(M3) -- {0: 0, 1: 1, 2: 2, 3: 3} -+ {3: 3, 0: 0, 1: 1, 2: 2} - - :: - -diff --git a/src/sage/matroids/linear_matroid.pyx b/src/sage/matroids/linear_matroid.pyx -index e72f7748d9..ea5b3ff08d 100644 ---- a/src/sage/matroids/linear_matroid.pyx -+++ b/src/sage/matroids/linear_matroid.pyx -@@ -2254,7 +2254,7 @@ cdef class LinearMatroid(BasisExchangeMatroid): - ....: [1, 0, 1], [0, 1, 1]]) - sage: N._linear_extension_chains(F=set([0, 1]), - ....: fundamentals=set([1, -1, 1/2, 2])) -- [{0: 1}, {}, {0: 1, 1: 1}, {0: -1, 1: 1}, {1: 1}] -+ [{0: 1}, {}, {1: 1, 0: 1}, {1: 1, 0: -1}, {1: 1}] - """ - - if len(F) == 0: -@@ -2341,7 +2341,7 @@ cdef class LinearMatroid(BasisExchangeMatroid): - sage: len(M.linear_extension_chains(F=[0, 1], simple=True)) - 0 - sage: M.linear_extension_chains(F=[0, 1, 2], simple=True) -- [{0: 1, 1: 1, 2: 1}] -+ [{2: 1, 1: 1, 0: 1}] - sage: N = Matroid(ring=QQ, - ....: reduced_matrix=[[-1, -1, 0], [1, 0, -1], [0, 1, 1]]) - sage: L = N.linear_extension_chains(F=[0, 1], simple=True, -@@ -2439,12 +2439,12 @@ cdef class LinearMatroid(BasisExchangeMatroid): - sage: len(M.linear_coextension_cochains(F=[0, 1], cosimple=True)) - 0 - sage: M.linear_coextension_cochains(F=[3, 4, 5], cosimple=True) -- [{3: 1, 4: 1, 5: 1}] -+ [{5: 1, 4: 1, 3: 1}] - sage: N = Matroid(ring=QQ, - ....: reduced_matrix=[[-1, -1, 0], [1, 0, -1], [0, 1, 1]]) - sage: N.linear_coextension_cochains(F=[0, 1], cosimple=True, - ....: fundamentals=set([1, -1, 1/2, 2])) -- [{0: 2, 1: 1}, {0: -1, 1: 1}, {0: 1/2, 1: 1}] -+ [{1: 1, 0: 2}, {1: 1, 0: -1}, {1: 1, 0: 1/2}] - """ - return self.dual().linear_extension_chains(F=F, simple=cosimple, fundamentals=fundamentals) - -@@ -3342,7 +3342,7 @@ cdef class BinaryMatroid(LinearMatroid): - sage: M1._is_isomorphic(M2) - True - sage: M1._is_isomorphic(M2, certificate=True) -- (True, {'a': 0, 'b': 1, 'c': 2, 'd': 4, 'e': 3, 'f': 5, 'g': 6}) -+ (True, {'f': 5, 'a': 0, 'b': 1, 'd': 4, 'c': 2, 'g': 6, 'e': 3}) - - sage: M1 = matroids.named_matroids.Fano().delete('a') - sage: M2 = matroids.Whirl(3) -@@ -3353,7 +3353,7 @@ cdef class BinaryMatroid(LinearMatroid): - sage: M1._is_isomorphic(matroids.Wheel(3)) - True - sage: M1._is_isomorphic(matroids.Wheel(3), certificate=True) -- (True, {'b': 1, 'c': 2, 'd': 4, 'e': 3, 'f': 5, 'g': 0}) -+ (True, {'d': 4, 'g': 0, 'e': 3, 'b': 1, 'c': 2, 'f': 5}) - - """ - if certificate: -@@ -6077,7 +6077,7 @@ cdef class RegularMatroid(LinearMatroid): - sage: M1._is_isomorphic(M2) - True - sage: M1._is_isomorphic(M2, certificate=True) -- (True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4}) -+ (True, {4: 5, 0: 0, 3: 3, 1: 1, 2: 2, 5: 4}) - - sage: M1 = matroids.Wheel(3) - sage: M2 = matroids.named_matroids.Fano() -@@ -6086,7 +6086,7 @@ cdef class RegularMatroid(LinearMatroid): - sage: M1._is_isomorphic(M2.delete('a')) - True - sage: M1._is_isomorphic(M2.delete('a'), certificate=True) -- (True, {0: 'g', 1: 'b', 2: 'c', 3: 'e', 4: 'd', 5: 'f'}) -+ (True, {4: 'd', 0: 'g', 3: 'e', 1: 'b', 2: 'c', 5: 'f'}) - - Check that :trac:`17316` was fixed:: - -diff --git a/src/sage/matroids/matroid.pyx b/src/sage/matroids/matroid.pyx -index 8c9753554a..00ddf25726 100644 ---- a/src/sage/matroids/matroid.pyx -+++ b/src/sage/matroids/matroid.pyx -@@ -3149,7 +3149,7 @@ cdef class Matroid(SageObject): - sage: M1.is_isomorphic(M2) - True - sage: M1.is_isomorphic(M2, certificate=True) -- (True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4}) -+ (True, {4: 5, 0: 0, 3: 3, 1: 1, 2: 2, 5: 4}) - sage: G3 = graphs.CompleteGraph(4) - sage: M1.is_isomorphic(G3) - Traceback (most recent call last): -@@ -3195,7 +3195,7 @@ cdef class Matroid(SageObject): - sage: M1._is_isomorphic(M2) - True - sage: M1._is_isomorphic(M2, certificate=True) -- (True, {0: 0, 1: 1, 2: 2, 3: 3, 4: 5, 5: 4}) -+ (True, {4: 5, 0: 0, 3: 3, 1: 1, 2: 2, 5: 4}) - - sage: M1 = matroids.named_matroids.Fano() - sage: M2 = matroids.named_matroids.NonFano() -@@ -3984,14 +3984,16 @@ cdef class Matroid(SageObject): - sage: matroids.named_matroids.NonFano().has_minor(M) - True - sage: matroids.named_matroids.NonFano().has_minor(M, certificate=True) -- (True, (frozenset(), frozenset({'g'}), -- {0: 'b', 1: 'c', 2: 'a', 3: 'd', 4: 'e', 5: 'f'})) -+ (True, -+ (frozenset(), -+ frozenset({'g'}), -+ {5: 'f', 2: 'a', 3: 'd', 0: 'b', 4: 'e', 1: 'c'})) - sage: M = matroids.named_matroids.Fano() - sage: M.has_minor(M, True) - (True, - (frozenset(), - frozenset(), -- {'a': 'a', 'b': 'b', 'c': 'c', 'd': 'd', 'e': 'e', 'f': 'f', 'g': 'g'})) -+ {...'a': 'a'...})) - """ - if not isinstance(N, Matroid): - raise ValueError("N must be a matroid.") -diff --git a/src/sage/matroids/matroids_plot_helpers.py b/src/sage/matroids/matroids_plot_helpers.py -index 1967c76c48..49d1b31d47 100644 ---- a/src/sage/matroids/matroids_plot_helpers.py -+++ b/src/sage/matroids/matroids_plot_helpers.py -@@ -121,8 +121,7 @@ def it(M, B1, nB1, lps): - sage: pts,trilines,nontripts,curvedlines = mph.it(M, - ....: B1,nB1,M.loops()) - sage: pts -- {1: (1.0, 0.0), 2: (1.5, 1.0), 3: (0.5, 1.0), -- 4: (0, 0), 5: (1, 2), 6: (2, 0)} -+ {4: (0, 0), 5: (1, 2), 6: (2, 0), 3: (0.5, 1.0), 2: (1.5, 1.0), 1: (1.0, 0.0)} - sage: trilines - [[3, 4, 5], [2, 5, 6], [1, 4, 6]] - sage: nontripts -diff --git a/src/sage/matroids/set_system.pyx b/src/sage/matroids/set_system.pyx -index b4f9a7fd36..4092230d05 100644 ---- a/src/sage/matroids/set_system.pyx -+++ b/src/sage/matroids/set_system.pyx -@@ -662,7 +662,7 @@ cdef class SetSystem: - sage: T = SetSystem(['a', 'b', 'c', 'd'], [['a', 'b'], ['c', 'd'], - ....: ['a', 'c', 'd']]) - sage: S._isomorphism(T) -- {1: 'c', 2: 'd', 3: 'b', 4: 'a'} -+ {3: 'b', 4: 'a', 2: 'd', 1: 'c'} - sage: S = SetSystem([], []) - sage: S._isomorphism(S) - {} -@@ -726,7 +726,7 @@ cdef class SetSystem: - sage: T = SetSystem(['a', 'b', 'c', 'd'], [['a', 'b'], ['c', 'd'], - ....: ['a', 'c', 'd']]) - sage: S._equivalence(lambda self, other, morph:True, T) -- {1: 'c', 2: 'd', 3: 'b', 4: 'a'} -+ {3: 'b', 4: 'a', 2: 'd', 1: 'c'} - - Check that :trac:`15189` is fixed:: - -diff --git a/src/sage/misc/abstract_method.py b/src/sage/misc/abstract_method.py -index 747f5dcda7..65ef9d9e95 100644 ---- a/src/sage/misc/abstract_method.py -+++ b/src/sage/misc/abstract_method.py -@@ -260,8 +260,8 @@ def abstract_methods_of_class(cls): - ....: def required2(): pass - - sage: sage.misc.abstract_method.abstract_methods_of_class(AbstractClass) -- {'optional': ['optional1', 'optional2'], -- 'required': ['required1', 'required2']} -+ {'required': ['required1', 'required2'], -+ 'optional': ['optional1', 'optional2']} - - """ - result = { "required" : [], -diff --git a/src/sage/modular/arithgroup/arithgroup_perm.py b/src/sage/modular/arithgroup/arithgroup_perm.py -index 4620c7b3c0..a447fb2caf 100644 ---- a/src/sage/modular/arithgroup/arithgroup_perm.py -+++ b/src/sage/modular/arithgroup/arithgroup_perm.py -@@ -2387,7 +2387,7 @@ class EvenArithmeticSubgroup_Permutation(ArithmeticSubgroup_Permutation_class): - sage: G.cusp_widths() - [1, 1, 4] - sage: G.cusp_widths(exp=True) -- {1: 2, 4: 1} -+ {4: 1, 1: 2} - - sage: S2 = "(1,2)(3,4)(5,6)" - sage: S3 = "(1,3,5)(2,4,6)" -diff --git a/src/sage/modular/arithgroup/congroup_gammaH.py b/src/sage/modular/arithgroup/congroup_gammaH.py -index f989b8e5b9..948ec41b2a 100644 ---- a/src/sage/modular/arithgroup/congroup_gammaH.py -+++ b/src/sage/modular/arithgroup/congroup_gammaH.py -@@ -594,6 +594,7 @@ class GammaH_class(CongruenceSubgroup): - sage: G = GammaH(240,[7,239]) - sage: G._coset_reduction_data_second_coord() - {1: [1], -+ 240: [1, 7, 49, 103, 137, 191, 233, 239], - 2: [1], - 3: [1], - 4: [1], -@@ -611,8 +612,7 @@ class GammaH_class(CongruenceSubgroup): - 48: [1, 191], - 60: [1, 49, 137, 233], - 80: [1, 7, 49, 103], -- 120: [1, 7, 49, 103, 137, 191, 233, 239], -- 240: [1, 7, 49, 103, 137, 191, 233, 239]} -+ 120: [1, 7, 49, 103, 137, 191, 233, 239]} - sage: G = GammaH(1200,[-1,7]); G - Congruence Subgroup Gamma_H(1200) with H generated by [7, 1199] - sage: K = sorted(G._coset_reduction_data_second_coord()) -diff --git a/src/sage/modular/dirichlet.py b/src/sage/modular/dirichlet.py -index 1204e39322..187befe1bb 100644 ---- a/src/sage/modular/dirichlet.py -+++ b/src/sage/modular/dirichlet.py -@@ -2276,7 +2276,7 @@ class DirichletGroup_class(WithEqualityById, Parent): - TESTS:: - - sage: DirichletGroup(5)._zeta_dlog -- {-1: 2, -zeta4: 3, zeta4: 1, 1: 0} -+ {1: 0, zeta4: 1, -1: 2, -zeta4: 3} - """ - return {z: i for i, z in enumerate(self._zeta_powers)} - -diff --git a/src/sage/parallel/parallelism.py b/src/sage/parallel/parallelism.py -index ad2dba4fbc..1cd1fa7ba4 100644 ---- a/src/sage/parallel/parallelism.py -+++ b/src/sage/parallel/parallelism.py -@@ -297,13 +297,13 @@ class Parallelism(Singleton, SageObject): - - sage: Parallelism().reset() - sage: Parallelism().get_all() -- {'linbox': 1, 'tensor': 1} -+ {'tensor': 1, 'linbox': 1} - - Asking for parallelization on 4 cores:: - - sage: Parallelism().set(nproc=4) - sage: Parallelism().get_all() -- {'linbox': 4, 'tensor': 4} -+ {'tensor': 4, 'linbox': 4} - - """ - return self._nproc -diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py -index 3c8caece49..4739879e25 100644 ---- a/src/sage/plot/graphics.py -+++ b/src/sage/plot/graphics.py -@@ -1295,8 +1295,8 @@ class Graphics(WithEqualityById, SageObject): - sage: G_kwds = Graphics._extract_kwds_for_show(kwds, ignore='xmin') - sage: kwds # Note how this action modifies the passed dictionary - {'f': <function <lambda> at 0x...>, -- 'plot_points': (40, 40), -- 'xmin': 0} -+ 'xmin': 0, -+ 'plot_points': (40, 40)} - sage: G_kwds - {'figsize': [1, 1]} - -@@ -2242,13 +2242,13 @@ class Graphics(WithEqualityById, SageObject): - - sage: l = line([(1e-19,-1), (-1e-19,+1)], aspect_ratio=1.0) - sage: l.get_minmax_data() -- {'xmax': 1.00010000000000e-15, -- 'xmin': -9.99900000000000e-16, -- 'ymax': 1.0, -- 'ymin': -1.0} -+ {'xmin': -9.99900000000000e-16, -+ 'xmax': 1.00010000000000e-15, -+ 'ymin': -1.0, -+ 'ymax': 1.0} - sage: l = line([(0,0), (1,1)], aspect_ratio=1e19) - sage: l.get_minmax_data() -- {'xmax': 5000.50000000000, 'xmin': -4999.50000000000, 'ymax': 1.0, 'ymin': 0.0} -+ {'xmin': -4999.50000000000, 'xmax': 5000.50000000000, 'ymin': 0.0, 'ymax': 1.0} - """ - objects = self._objects - if objects: -@@ -2301,18 +2301,18 @@ class Graphics(WithEqualityById, SageObject): - - sage: l = line([(0,0), (1,1)], aspect_ratio=1.0) - sage: l._limit_output_aspect_ratio(1, 2, 1e19, 3) -- {'xmax': -4999.50000000000, -- 'xmin': 5000.50000000000, -- 'ymax': 3, -- 'ymin': 1.00000000000000e19} -+ {'xmin': 5000.50000000000, -+ 'xmax': -4999.50000000000, -+ 'ymin': 1.00000000000000e19, -+ 'ymax': 3} - sage: l._limit_output_aspect_ratio(1, 2, 3, 1e19) -- {'xmax': 5000.50000000000, -- 'xmin': -4999.50000000000, -- 'ymax': 1.00000000000000e19, -- 'ymin': 3} -+ {'xmin': -4999.50000000000, -+ 'xmax': 5000.50000000000, -+ 'ymin': 3, -+ 'ymax': 1.00000000000000e19} - sage: l = line([(0,0), (1,1)], aspect_ratio=1e16) - sage: l._limit_output_aspect_ratio(0, 1, 2, 3) -- {'xmax': 5.50000000000000, 'xmin': -4.50000000000000, 'ymax': 3, 'ymin': 2} -+ {'xmin': -4.50000000000000, 'xmax': 5.50000000000000, 'ymin': 2, 'ymax': 3} - """ - aspect_ratio = self.aspect_ratio() - if aspect_ratio != 'automatic': -diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py -index e0c608e23e..0e29b40d72 100644 ---- a/src/sage/plot/histogram.py -+++ b/src/sage/plot/histogram.py -@@ -74,7 +74,7 @@ class Histogram(GraphicPrimitive): - - sage: H = histogram([10,3,5], density=True); h = H[0] - sage: h.get_minmax_data() # rel tol 1e-15 -- {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.4761904761904765, 'ymin': 0} -+ {'xmin': 3.0, 'xmax': 10.0, 'ymin': 0, 'ymax': 0.47619047619047665} - sage: G = histogram([random() for _ in range(500)]); g = G[0] - sage: g.get_minmax_data() # random output - {'xmax': 0.99729312925213209, 'xmin': 0.00013024562219410285, 'ymax': 61, 'ymin': 0} -@@ -94,7 +94,7 @@ class Histogram(GraphicPrimitive): - sage: h.get_minmax_data() - doctest:warning ... - ...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy. -- {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0} -+ {'xmin': 3.0, 'xmax': 10.0, 'ymin': 0, 'ymax': 0.476190476190...} - """ - import numpy - -diff --git a/src/sage/plot/plot3d/base.pyx b/src/sage/plot/plot3d/base.pyx -index 2d53ec2394..a10ebb261c 100644 ---- a/src/sage/plot/plot3d/base.pyx -+++ b/src/sage/plot/plot3d/base.pyx -@@ -2141,14 +2141,14 @@ class Graphics3dGroup(Graphics3d): - sage: G = point3d((1,2,3)) + point3d((4,5,6)) + line3d([(1,2,3), (4,5,6)]) - sage: G.threejs_repr(G.default_render_params()) - [('point', -- {'color': '#6666ff', 'opacity': 1.0, 'point': (1.0, 2.0, 3.0), 'size': 5.0}), -+ {'point': (1.0, 2.0, 3.0), 'size': 5.0, 'color': '#6666ff', 'opacity': 1.0}), - ('point', -- {'color': '#6666ff', 'opacity': 1.0, 'point': (4.0, 5.0, 6.0), 'size': 5.0}), -+ {'point': (4.0, 5.0, 6.0), 'size': 5.0, 'color': '#6666ff', 'opacity': 1.0}), - ('line', -- {'color': '#6666ff', -- 'linewidth': 1.0, -+ {'points': [(1.0, 2.0, 3.0), (4.0, 5.0, 6.0)], -+ 'color': '#6666ff', - 'opacity': 1.0, -- 'points': [(1.0, 2.0, 3.0), (4.0, 5.0, 6.0)]})] -+ 'linewidth': 1.0})] - - """ - reprs = [] -@@ -2422,12 +2422,12 @@ class TransformGroup(Graphics3dGroup): - sage: G = G.translate(-1, -2, -3).scale(10) - sage: G.threejs_repr(G.default_render_params()) - [('point', -- {'color': '#6666ff', 'opacity': 1.0, 'point': (0.0, 0.0, 0.0), 'size': 5.0}), -+ {'point': (0.0, 0.0, 0.0), 'size': 5.0, 'color': '#6666ff', 'opacity': 1.0}), - ('point', -- {'color': '#6666ff', -- 'opacity': 1.0, -- 'point': (30.0, 30.0, 30.0), -- 'size': 5.0})] -+ {'point': (30.0, 30.0, 30.0), -+ 'size': 5.0, -+ 'color': '#6666ff', -+ 'opacity': 1.0})] - - """ - render_params.push_transform(self.get_transformation()) -@@ -2643,12 +2643,12 @@ cdef class PrimitiveObject(Graphics3d): - sage: G = SimpleTriangle() - sage: G.threejs_repr(G.default_render_params()) - [('surface', -- {'color': '#0000ff', -- 'faces': [[0, 1, 2]], -- 'opacity': 1.0, -- 'vertices': [{'x': 0.0, 'y': 0.0, 'z': 0.0}, -+ {'vertices': [{'x': 0.0, 'y': 0.0, 'z': 0.0}, - {'x': 1.0, 'y': 0.0, 'z': 0.0}, -- {'x': 0.0, 'y': 1.0, 'z': 0.0}]})] -+ {'x': 0.0, 'y': 1.0, 'z': 0.0}], -+ 'faces': [[0, 1, 2]], -+ 'color': '#0000ff', -+ 'opacity': 1.0})] - - """ - return self.triangulation().threejs_repr(render_params) -diff --git a/src/sage/plot/plot3d/implicit_surface.pyx b/src/sage/plot/plot3d/implicit_surface.pyx -index c9828cbd19..b4372f36ec 100644 ---- a/src/sage/plot/plot3d/implicit_surface.pyx -+++ b/src/sage/plot/plot3d/implicit_surface.pyx -@@ -1155,15 +1155,15 @@ cdef class ImplicitSurface(IndexFaceSet): - sage: G = ImplicitSurface(x + y + z, (x,-1, 1), (y,-1, 1), (z,-1, 1)) - sage: G.threejs_repr(G.default_render_params()) - [('surface', -- {'color': '#6666ff', -- 'faces': [[0, 1, 2], -- ... -- 'opacity': 1.0, -- 'vertices': [{'x': ..., -+ {'vertices': [{'x': ..., - 'y': -0.9743589743589..., - 'z': -0.02564102564102...}, - ... -- {'x': -1.0, 'y': 0.9487179487179..., 'z': 0.05128205128205...}]})] -+ {'x': -1.0, 'y': 0.9487179487179..., 'z': 0.05128205128205...}], -+ 'faces': [[0, 1, 2], -+ ... -+ 'color': '#6666ff', -+ 'opacity': 1.0})] - """ - self.triangulate() - return IndexFaceSet.threejs_repr(self, render_params) -diff --git a/src/sage/plot/plot3d/index_face_set.pyx b/src/sage/plot/plot3d/index_face_set.pyx -index 1f6b542224..a1014f8367 100644 ---- a/src/sage/plot/plot3d/index_face_set.pyx -+++ b/src/sage/plot/plot3d/index_face_set.pyx -@@ -1295,12 +1295,12 @@ cdef class IndexFaceSet(PrimitiveObject): - sage: G = polygon([(0,0,1), (1,1,1), (2,0,1)]) - sage: G.threejs_repr(G.default_render_params()) - [('surface', -- {'color': '#0000ff', -- 'faces': [[0, 1, 2]], -- 'opacity': 1.0, -- 'vertices': [{'x': 0.0, 'y': 0.0, 'z': 1.0}, -+ {'vertices': [{'x': 0.0, 'y': 0.0, 'z': 1.0}, - {'x': 1.0, 'y': 1.0, 'z': 1.0}, -- {'x': 2.0, 'y': 0.0, 'z': 1.0}]})] -+ {'x': 2.0, 'y': 0.0, 'z': 1.0}], -+ 'faces': [[0, 1, 2]], -+ 'color': '#0000ff', -+ 'opacity': 1.0})] - - The same but with more options applied:: - -@@ -1309,16 +1309,16 @@ cdef class IndexFaceSet(PrimitiveObject): - ....: single_side=True, mesh=True) - sage: G.threejs_repr(G.default_render_params()) - [('surface', -- {'color': '#ff0000', -+ {'vertices': [{'x': 0.0, 'y': 0.0, 'z': 1.0}, -+ {'x': 1.0, 'y': 1.0, 'z': 1.0}, -+ {'x': 2.0, 'y': 0.0, 'z': 1.0}], - 'faces': [[0, 1, 2]], -+ 'color': '#ff0000', - 'opacity': 0.5, - 'renderOrder': 2.0, -- 'showMeshGrid': True, - 'singleSide': True, - 'useFlatShading': True, -- 'vertices': [{'x': 0.0, 'y': 0.0, 'z': 1.0}, -- {'x': 1.0, 'y': 1.0, 'z': 1.0}, -- {'x': 2.0, 'y': 0.0, 'z': 1.0}]})] -+ 'showMeshGrid': True})] - - TESTS: - -@@ -1327,12 +1327,12 @@ cdef class IndexFaceSet(PrimitiveObject): - sage: G = polygon([(0,0,1), (1,1,1), (2,0,1)]).scale(2,1,-1) - sage: G.threejs_repr(G.default_render_params()) - [('surface', -- {'color': '#0000ff', -- 'faces': [[0, 1, 2]], -- 'opacity': 1.0, -- 'vertices': [{'x': 0.0, 'y': 0.0, 'z': -1.0}, -+ {'vertices': [{'x': 0.0, 'y': 0.0, 'z': -1.0}, - {'x': 2.0, 'y': 1.0, 'z': -1.0}, -- {'x': 4.0, 'y': 0.0, 'z': -1.0}]})] -+ {'x': 4.0, 'y': 0.0, 'z': -1.0}], -+ 'faces': [[0, 1, 2]], -+ 'color': '#0000ff', -+ 'opacity': 1.0})] - - Per-face colors:: - -@@ -1345,15 +1345,15 @@ cdef class IndexFaceSet(PrimitiveObject): - sage: S = IndexFaceSet(face_list, point_list, texture_list=t_list) - sage: S.threejs_repr(S.default_render_params()) - [('surface', -- {'faceColors': ['#ff0000', '#ff9900', '#cbff00', '#33ff00'], -- 'faces': [[0, 4, 5], [3, 4, 5], [2, 3, 4], [1, 3, 5]], -- 'opacity': 1.0, -- 'vertices': [{'x': 2.0, 'y': 0.0, 'z': 0.0}, -+ {'vertices': [{'x': 2.0, 'y': 0.0, 'z': 0.0}, - {'x': 0.0, 'y': 2.0, 'z': 0.0}, - {'x': 0.0, 'y': 0.0, 'z': 2.0}, - {'x': 0.0, 'y': 1.0, 'z': 1.0}, - {'x': 1.0, 'y': 0.0, 'z': 1.0}, -- {'x': 1.0, 'y': 1.0, 'z': 0.0}]})] -+ {'x': 1.0, 'y': 1.0, 'z': 0.0}], -+ 'faces': [[0, 4, 5], [3, 4, 5], [2, 3, 4], [1, 3, 5]], -+ 'faceColors': ['#ff0000', '#ff9900', '#cbff00', '#33ff00'], -+ 'opacity': 1.0})] - - """ - surface = {} -diff --git a/src/sage/plot/plot3d/parametric_surface.pyx b/src/sage/plot/plot3d/parametric_surface.pyx -index 42d3cb3743..8439fdd52c 100644 ---- a/src/sage/plot/plot3d/parametric_surface.pyx -+++ b/src/sage/plot/plot3d/parametric_surface.pyx -@@ -319,13 +319,13 @@ cdef class ParametricSurface(IndexFaceSet): - sage: P = plot3d(x^2-y^2, (x, -2, 2), (y, -2, 2)) - sage: P.threejs_repr(P.default_render_params()) - [('surface', -- {'color': '#6666ff', -- 'faces': [[0, 1, 2, 3], -+ {'vertices': [{'x': -2.0, 'y': -2.0, 'z': 0.0}, - ... -- 'opacity': 1.0, -- 'vertices': [{'x': -2.0, 'y': -2.0, 'z': 0.0}, -+ {'x': 2.0, 'y': 2.0, 'z': 0.0}], -+ 'faces': [[0, 1, 2, 3], - ... -- {'x': 2.0, 'y': 2.0, 'z': 0.0}]})] -+ 'color': '#6666ff', -+ 'opacity': 1.0})] - - """ - self.triangulate(render_params) -diff --git a/src/sage/plot/plot3d/shapes.pyx b/src/sage/plot/plot3d/shapes.pyx -index 6b6150ed5a..5aa418b634 100644 ---- a/src/sage/plot/plot3d/shapes.pyx -+++ b/src/sage/plot/plot3d/shapes.pyx -@@ -1170,7 +1170,7 @@ class Text(PrimitiveObject): - - sage: T = text3d("Hi", (1, 2, 3), color='red') - sage: T.threejs_repr(T.default_render_params()) -- [('text', {'color': '#ff0000', 'text': 'Hi', 'x': 1.0, 'y': 2.0, 'z': 3.0})] -+ [('text', {'text': 'Hi', 'x': 1.0, 'y': 2.0, 'z': 3.0, 'color': '#ff0000'})] - - TESTS: - -@@ -1180,7 +1180,7 @@ class Text(PrimitiveObject): - sage: from sage.plot.plot3d.shapes import Text - sage: T = Text("Hi") - sage: T.threejs_repr(T.default_render_params()) -- [('text', {'color': '#6666ff', 'text': 'Hi', 'x': 0.0, 'y': 0.0, 'z': 0.0})] -+ [('text', {'text': 'Hi', 'x': 0.0, 'y': 0.0, 'z': 0.0, 'color': '#6666ff'})] - - """ - center = (float(0), float(0), float(0)) -diff --git a/src/sage/plot/plot3d/shapes2.py b/src/sage/plot/plot3d/shapes2.py -index 7a8c4cebd7..a0c481c856 100644 ---- a/src/sage/plot/plot3d/shapes2.py -+++ b/src/sage/plot/plot3d/shapes2.py -@@ -826,7 +826,10 @@ class Point(PrimitiveObject): - sage: P = point3d((1,2,3), color=(0,1,0), opacity=0.5, size=10) - sage: P.threejs_repr(P.default_render_params()) - [('point', -- {'color': '#00ff00', 'opacity': 0.5, 'point': (1.0, 2.0, 3.0), 'size': 10.0})] -+ {'point': (1.0, 2.0, 3.0), -+ 'size': 10.0, -+ 'color': '#00ff00', -+ 'opacity': 0.5})] - - TESTS: - -@@ -835,7 +838,7 @@ class Point(PrimitiveObject): - sage: P = point3d((1,2,3)).translate(-1, -2, -3) - sage: P.threejs_repr(P.default_render_params()) - [('point', -- {'color': '#6666ff', 'opacity': 1.0, 'point': (0.0, 0.0, 0.0), 'size': 5.0})] -+ {'point': (0.0, 0.0, 0.0), 'size': 5.0, 'color': '#6666ff', 'opacity': 1.0})] - - """ - transform = render_params.transform -@@ -1134,10 +1137,10 @@ class Line(PrimitiveObject): - sage: L = line3d([(1,2,3), (4,5,6)], thickness=10, color=(1,0,0), opacity=0.5) - sage: L.threejs_repr(L.default_render_params()) - [('line', -- {'color': '#ff0000', -- 'linewidth': 10.0, -+ {'points': [(1.0, 2.0, 3.0), (4.0, 5.0, 6.0)], -+ 'color': '#ff0000', - 'opacity': 0.5, -- 'points': [(1.0, 2.0, 3.0), (4.0, 5.0, 6.0)]})] -+ 'linewidth': 10.0})] - - TESTS: - -@@ -1146,10 +1149,10 @@ class Line(PrimitiveObject): - sage: L = line3d([(1,2,3), (4,5,6)]).translate(-1, -2, -3) - sage: L.threejs_repr(L.default_render_params()) - [('line', -- {'color': '#6666ff', -- 'linewidth': 1.0, -+ {'points': [(0.0, 0.0, 0.0), (3.0, 3.0, 3.0)], -+ 'color': '#6666ff', - 'opacity': 1.0, -- 'points': [(0.0, 0.0, 0.0), (3.0, 3.0, 3.0)]})] -+ 'linewidth': 1.0})] - - When setting ``arrow_head=True``, the last line segment is replaced by - an arrow with a width half the thickness of the line:: -@@ -1158,10 +1161,10 @@ class Line(PrimitiveObject): - sage: L_repr = L.threejs_repr(L.default_render_params()) - sage: L_repr[-1] - ('line', -- {'color': '#6666ff', -- 'linewidth': 4.0, -- 'opacity': 1.0, -- 'points': [(0.0, 0.0, 0.0), (1.0, 1.0, 1.0)]}) -+ {'points': [(0.0, 0.0, 0.0), (1.0, 1.0, 1.0)], -+ 'color': '#6666ff', -+ 'opacity': 1.0, -+ 'linewidth': 4.0}) - sage: A = arrow3d((1,1,1), (2,2,2), width=2) - sage: A_repr = A.threejs_repr(A.default_render_params()) - sage: A_repr == L_repr[:-1] -@@ -1175,10 +1178,10 @@ class Line(PrimitiveObject): - sage: L_repr = L.threejs_repr(L.default_render_params()) - sage: L_repr[-1] - ('line', -- {'color': '#ff0000', -- 'linewidth': 4.0, -- 'opacity': 0.5, -- 'points': [(-1.0, -1.0, -1.0), (0.0, 0.0, 0.0)]}) -+ {'points': [(-1.0, -1.0, -1.0), (0.0, 0.0, 0.0)], -+ 'color': '#ff0000', -+ 'opacity': 0.5, -+ 'linewidth': 4.0}) - sage: A = arrow3d((1,1,1), (2,2,2), width=2, color=(1,0,0), opacity=0.5) - sage: A = A.translate(-1, -1, -1) - sage: A_repr = A.threejs_repr(A.default_render_params()) -diff --git a/src/sage/repl/display/pretty_print.py b/src/sage/repl/display/pretty_print.py -index 28f150bfb3..2e46563cf0 100644 ---- a/src/sage/repl/display/pretty_print.py -+++ b/src/sage/repl/display/pretty_print.py -@@ -83,7 +83,7 @@ class SagePrettyPrinter(PrettyPrinter): - sage: set({1, 2, 3}) - {1, 2, 3} - sage: dict(zzz=123, aaa=99, xab=10) # sorted by keys -- {'aaa': 99, 'xab': 10, 'zzz': 123} -+ {'zzz': 123, 'aaa': 99, 'xab': 10} - - These are overridden in IPython in a way that we feel is somewhat - confusing, and we prefer to print them like plain Python which is -diff --git a/src/sage/rings/asymptotic/asymptotic_expansion_generators.py b/src/sage/rings/asymptotic/asymptotic_expansion_generators.py -index 7cddd91066..3f45d0a2f4 100644 ---- a/src/sage/rings/asymptotic/asymptotic_expansion_generators.py -+++ b/src/sage/rings/asymptotic/asymptotic_expansion_generators.py -@@ -1464,8 +1464,8 @@ def _sa_coefficients_lambda_(K, beta=0): - (1, 2): 1/2, - (2, 2): 1, - (2, 3): -5/6, -- (2, 4): 1/8, - (3, 3): -1, -+ (2, 4): 1/8, - (3, 4): 13/12, - (4, 4): 1} - sage: _sa_coefficients_lambda_(3, beta=1) -@@ -1474,8 +1474,8 @@ def _sa_coefficients_lambda_(K, beta=0): - (1, 2): 1/2, - (2, 2): 3, - (2, 3): -4/3, -- (2, 4): 1/8, - (3, 3): -4, -+ (2, 4): 1/8, - (3, 4): 29/12, - (4, 4): 5} - """ -diff --git a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py -index 2c2a40092f..f28a3592d1 100644 ---- a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py -+++ b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py -@@ -3790,7 +3790,7 @@ def subs_all(f, sub, simplify=False): - sage: a = {'foo': x**2 + y**2, 'bar': x - y} - sage: b = {x: 1 , y: 2} - sage: subs_all(a, b) -- {'bar': -1, 'foo': 5} -+ {'foo': 5, 'bar': -1} - """ - singleton = False - if not isinstance(f, (list, tuple)): -diff --git a/src/sage/rings/finite_rings/hom_finite_field.pyx b/src/sage/rings/finite_rings/hom_finite_field.pyx -index bb216a813e..824e4ff5f3 100644 ---- a/src/sage/rings/finite_rings/hom_finite_field.pyx -+++ b/src/sage/rings/finite_rings/hom_finite_field.pyx -@@ -439,13 +439,13 @@ cdef class FiniteFieldHomomorphism_generic(RingHomomorphism_im_gens): - (<class 'sage.rings.finite_rings.hom_prime_finite_field.FiniteFieldHomomorphism_prime'>, - Set of field embeddings from Finite Field of size 5 to Finite Field in t of size 5^3, - {}, -- {'__im_gens': [1], -- '_base_map': None, -+ {'_domain': Finite Field of size 5, - '_codomain': Finite Field in t of size 5^3, -- '_domain': Finite Field of size 5, - '_is_coercion': False, -- '_lift': None, - '_repr_type_str': None, -+ '_lift': None, -+ '__im_gens': [1], -+ '_base_map': None, - '_section_class': <class 'sage.rings.finite_rings.hom_prime_finite_field.SectionFiniteFieldHomomorphism_prime'>})) - """ - cdef dict slots -@@ -826,12 +826,12 @@ cdef class FrobeniusEndomorphism_finite_field(FrobeniusEndomorphism_generic): - (<class 'sage.rings.finite_rings.hom_finite_field_givaro.FrobeniusEndomorphism_givaro'>, - Automorphism group of Finite Field in t of size 5^3, - {}, -- {'_codomain': Finite Field in t of size 5^3, -- '_domain': Finite Field in t of size 5^3, -+ {'_domain': Finite Field in t of size 5^3, -+ '_codomain': Finite Field in t of size 5^3, - '_is_coercion': False, -+ '_repr_type_str': None, - '_lift': None, -- '_power': 2, -- '_repr_type_str': None})) -+ '_power': 2})) - """ - cdef dict slots - slots = FrobeniusEndomorphism_generic._extra_slots(self) -diff --git a/src/sage/rings/function_field/divisor.py b/src/sage/rings/function_field/divisor.py -index e37dbf3bd5..de2225cc15 100644 ---- a/src/sage/rings/function_field/divisor.py -+++ b/src/sage/rings/function_field/divisor.py -@@ -394,11 +394,11 @@ class FunctionFieldDivisor(ModuleElement): - sage: L.<y> = K.extension(Y^3 + x^3*Y + x) - sage: f = x/(y + 1) - sage: D = f.divisor() -- sage: D.dict() -- {Place (1/x, 1/x^3*y^2 + 1/x): -1, -- Place (1/x, 1/x^3*y^2 + 1/x^2*y + 1): 1, -- Place (x, y): 3, -- Place (x^3 + x + 1, y + 1): -1} -+ sage: sorted(D.dict().items()) -+ [(Place (1/x, 1/x^3*y^2 + 1/x), -1), -+ (Place (1/x, 1/x^3*y^2 + 1/x^2*y + 1), 1), -+ (Place (x, y), 3), -+ (Place (x^3 + x + 1, y + 1), -1)] - """ - return self._data - -diff --git a/src/sage/rings/invariants/invariant_theory.py b/src/sage/rings/invariants/invariant_theory.py -index 12a4c130ab..48ca15952a 100644 ---- a/src/sage/rings/invariants/invariant_theory.py -+++ b/src/sage/rings/invariants/invariant_theory.py -@@ -2411,10 +2411,10 @@ class BinaryQuintic(AlgebraicForm): - sage: p = 2*x1^5 + 4*x1^4*x0 + 5*x1^3*x0^2 + 7*x1^2*x0^3 - 11*x1*x0^4 + x0^5 - sage: quintic = invariant_theory.binary_quintic(p, x0, x1) - sage: quintic.arithmetic_invariants() -- {'I12': -1156502613073152, -- 'I18': -12712872348048797642752, -- 'I4': -138016, -- 'I8': 14164936192} -+ {'I4': -138016, -+ 'I8': 14164936192, -+ 'I12': -1156502613073152, -+ 'I18': -12712872348048797642752} - - We can check that the coefficients of the invariants have no common divisor - for a general quintic form:: -diff --git a/src/sage/rings/multi_power_series_ring_element.py b/src/sage/rings/multi_power_series_ring_element.py -index dd1f5df5e4..a1e2988f38 100644 ---- a/src/sage/rings/multi_power_series_ring_element.py -+++ b/src/sage/rings/multi_power_series_ring_element.py -@@ -1108,8 +1108,8 @@ class MPowerSeries(PowerSeries): - sage: s = m + m2 - sage: s.dict() - {(1, 15, 0, 48): 2/3, -- (12, 29, 46, 6): 1/2, - (15, 21, 28, 5): -1, -+ (12, 29, 46, 6): 1/2, - (39, 5, 23, 30): -1/4} - """ - out_dict = {} -@@ -1201,9 +1201,9 @@ class MPowerSeries(PowerSeries): - Multivariate Power Series Ring in s, t over Integer Ring - sage: f = 1 + t + s + s*t + R.O(3) - sage: f.coefficients() -- {s*t: 1, t: 1, s: 1, 1: 1} -+ {1: 1, s: 1, t: 1, s*t: 1} - sage: (f^2).coefficients() -- {t^2: 1, s*t: 4, s^2: 1, t: 2, s: 2, 1: 1} -+ {1: 1, s: 2, t: 2, s^2: 1, s*t: 4, t^2: 1} - - sage: g = f^2 + f - 2; g - 3*s + 3*t + s^2 + 5*s*t + t^2 + O(s, t)^3 -diff --git a/src/sage/rings/number_field/S_unit_solver.py b/src/sage/rings/number_field/S_unit_solver.py -index 16593f89ee..fbef474be2 100644 ---- a/src/sage/rings/number_field/S_unit_solver.py -+++ b/src/sage/rings/number_field/S_unit_solver.py -@@ -1595,7 +1595,7 @@ def clean_rfv_dict(rfv_dictionary): - sage: len(rfv_dict) - 4 - sage: rfv_dict -- {(1, 3): [3, 2], (2, 1): [4, 6], (3, 0): [6, 6], (5, 4): [3, 6]} -+ {(1, 3): [3, 2], (3, 0): [6, 6], (5, 4): [3, 6], (2, 1): [4, 6]} - """ - - for a, val in list(rfv_dictionary.items()): -@@ -1759,31 +1759,31 @@ def construct_comp_exp_vec(rfv_to_ev_dict, q): - sage: from sage.rings.number_field.S_unit_solver import construct_comp_exp_vec - sage: rfv_to_ev_dict = {(6, 6): [(3, 0)], (5, 6): [(1, 2)], (5, 4): [(5, 3)], (6, 2): [(5, 5)], (2, 5): [(0, 1)], (5, 5): [(3, 4)], (4, 4): [(0, 2)], (6, 3): [(1, 4)], (3, 6): [(5, 4)], (2, 2): [(0, 4)], (3, 5): [(1, 0)], (6, 4): [(1, 1)], (3, 2): [(1, 3)], (2, 6): [(4, 5)], (4, 5): [(4, 3)], (2, 3): [(2, 3)], (4, 2): [(4, 0)], (6, 5): [(5, 2)], (3, 3): [(3, 2)], (5, 3): [(5, 0)], (4, 6): [(2, 1)], (3, 4): [(3, 5)], (4, 3): [(0, 5)], (5, 2): [(3, 1)], (2, 4): [(2, 0)]} - sage: construct_comp_exp_vec(rfv_to_ev_dict, 7) -- {(0, 1): [(1, 4)], -+ {(3, 0): [(0, 4)], -+ (1, 2): [(1, 3)], -+ (5, 3): [(3, 5)], -+ (5, 5): [(4, 5)], -+ (0, 1): [(1, 4)], -+ (3, 4): [(3, 2)], - (0, 2): [(0, 2)], -+ (1, 4): [(0, 1)], -+ (5, 4): [(3, 1)], - (0, 4): [(3, 0)], -- (0, 5): [(4, 3)], - (1, 0): [(5, 0)], - (1, 1): [(2, 0)], -- (1, 2): [(1, 3)], - (1, 3): [(1, 2)], -- (1, 4): [(0, 1)], -- (2, 0): [(1, 1)], -- (2, 1): [(4, 0)], -+ (4, 5): [(5, 5)], -+ (4, 3): [(0, 5)], - (2, 3): [(5, 2)], -- (3, 0): [(0, 4)], -- (3, 1): [(5, 4)], -- (3, 2): [(3, 4)], -- (3, 4): [(3, 2)], -- (3, 5): [(5, 3)], - (4, 0): [(2, 1)], -- (4, 3): [(0, 5)], -- (4, 5): [(5, 5)], -- (5, 0): [(1, 0)], - (5, 2): [(2, 3)], -- (5, 3): [(3, 5)], -- (5, 4): [(3, 1)], -- (5, 5): [(4, 5)]} -+ (3, 2): [(3, 4)], -+ (5, 0): [(1, 0)], -+ (2, 1): [(4, 0)], -+ (3, 5): [(5, 3)], -+ (0, 5): [(4, 3)], -+ (3, 1): [(5, 4)], -+ (2, 0): [(1, 1)]} - """ - - comp_exp_vec_dict = {} -diff --git a/src/sage/rings/padics/lattice_precision.py b/src/sage/rings/padics/lattice_precision.py -index 6cb4f04d17..132d2ed48c 100644 ---- a/src/sage/rings/padics/lattice_precision.py -+++ b/src/sage/rings/padics/lattice_precision.py -@@ -1514,7 +1514,7 @@ class DifferentialPrecisionGeneric(SageObject): - - sage: prec.history_clear() - sage: prec.timings() -- {'add': 0, 'del': 0, 'full reduce': 0, 'mark': 0, 'partial reduce': 0} -+ {'add': 0, 'del': 0, 'mark': 0, 'partial reduce': 0, 'full reduce': 0} - """ - if self._history is None: - raise ValueError("History is not tracked") -diff --git a/src/sage/rings/polynomial/groebner_fan.py b/src/sage/rings/polynomial/groebner_fan.py -index 6bac81e277..3c5892f9b8 100644 ---- a/src/sage/rings/polynomial/groebner_fan.py -+++ b/src/sage/rings/polynomial/groebner_fan.py -@@ -1504,13 +1504,13 @@ class GroebnerFan(SageObject): - sage: R.<x,y> = PolynomialRing(QQ) - sage: G = R.ideal([y^3 - x^2, y^2 - 13*x]).groebner_fan() - sage: G._gfan_stats() -- {'Dimension of homogeneity space': 0, -- 'Maximal number of polynomials in Groebner basis': 3, -- 'Maximal number of terms in Groebner basis': 6, -+ {'Number of reduced Groebner bases': 3, -+ 'Number of variables': 2, -+ 'Dimension of homogeneity space': 0, - 'Maximal total degree of a Groebner basis': 4, - 'Minimal total degree of a Groebner basis': 2, -- 'Number of reduced Groebner bases': 3, -- 'Number of variables': 2} -+ 'Maximal number of polynomials in Groebner basis': 3, -+ 'Maximal number of terms in Groebner basis': 6} - """ - try: - return self.__stats -diff --git a/src/sage/rings/polynomial/laurent_polynomial.pyx b/src/sage/rings/polynomial/laurent_polynomial.pyx -index 17904ad8b1..b356714dba 100644 ---- a/src/sage/rings/polynomial/laurent_polynomial.pyx -+++ b/src/sage/rings/polynomial/laurent_polynomial.pyx -@@ -2148,7 +2148,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial): - sage: L.<w,z> = LaurentPolynomialRing(QQ) - sage: a = w^2*z^-1 +3 - sage: a.dict() # indirect doctest -- {(0, 0): 3, (2, -1): 1} -+ {(2, -1): 1, (0, 0): 3} - """ - cdef dict D = <dict> self._poly._mpoly_dict_recursive(self._parent.variable_names(), - self._parent.base_ring()) -diff --git a/src/sage/rings/polynomial/multi_polynomial.pyx b/src/sage/rings/polynomial/multi_polynomial.pyx -index 51ada7c969..801698b847 100644 ---- a/src/sage/rings/polynomial/multi_polynomial.pyx -+++ b/src/sage/rings/polynomial/multi_polynomial.pyx -@@ -504,7 +504,7 @@ cdef class MPolynomial(CommutativeRingElement): - sage: t,s = R.gens() - sage: x,y,z = R.base_ring().gens() - sage: (x+y+2*z*s+3*t)._mpoly_dict_recursive(('z','t','s')) -- {(0, 0, 0): x + y, (0, 1, 0): 3, (1, 0, 1): 2} -+ {(0, 0, 0): x + y, (1, 0, 1): 2, (0, 1, 0): 3} - - TESTS:: - -diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py -index 547dc32ee8..8806a69342 100644 ---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py -+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py -@@ -3676,11 +3676,11 @@ class MPolynomialIdeal( MPolynomialIdeal_singular_repr, \ - - sage: loads(dumps(I)).__getstate__() - (Monoid of ideals of Multivariate Polynomial Ring in x, y over Finite Field of size 32003, -- {'_Ideal_generic__gens': (x^2 + x, y), -- '_Ideal_generic__ring': Multivariate Polynomial Ring in x, y over Finite Field of size 32003, -- '_cache__groebner_basis': {}, -+ {'_Ideal_generic__ring': Multivariate Polynomial Ring in x, y over Finite Field of size 32003, -+ '_Ideal_generic__gens': (x^2 + x, y), - '_gb_by_ordering': {'degrevlex': [x^2 + x, y]}, - 'gens': Pickle of the cached method "gens", -+ '_cache__groebner_basis': {}, - 'groebner_basis': Pickle of the cached method "groebner_basis"}) - - This example checks :trac:`12802`:: -diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx -index ab1879650e..c38c4df03d 100644 ---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx -+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx -@@ -2980,7 +2980,7 @@ cdef class MPolynomial_libsingular(MPolynomial): - sage: R.<x,y,z> = QQ[] - sage: f=2*x*y^3*z^2 + 1/7*x^2 + 2/3 - sage: f.dict() -- {(0, 0, 0): 2/3, (1, 3, 2): 2, (2, 0, 0): 1/7} -+ {(1, 3, 2): 2, (2, 0, 0): 1/7, (0, 0, 0): 2/3} - """ - cdef poly *p - cdef ring *r = self._parent_ring -diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx -index 42001d4fcf..e1a0dad01b 100644 ---- a/src/sage/rings/polynomial/plural.pyx -+++ b/src/sage/rings/polynomial/plural.pyx -@@ -2197,7 +2197,7 @@ cdef class NCPolynomial_plural(RingElement): - - sage: f = (2*x*y^3*z^2 + (7)*x^2 + (3)) - sage: f.dict() -- {(0, 0, 0): 3, (1, 2, 3): 2, (2, 0, 0): 7} -+ {(2, 0, 0): 7, (1, 2, 3): 2, (0, 0, 0): 3} - """ - cdef poly *p - cdef ring *r -diff --git a/src/sage/rings/polynomial/polydict.pyx b/src/sage/rings/polynomial/polydict.pyx -index f86c7c7990..ad624ed901 100644 ---- a/src/sage/rings/polynomial/polydict.pyx -+++ b/src/sage/rings/polynomial/polydict.pyx -@@ -285,7 +285,7 @@ cdef class PolyDict: - sage: from sage.rings.polynomial.polydict import PolyDict - sage: f = PolyDict({(2,3):2, (1,2):3, (2,1):4}) - sage: f.dict() -- {(1, 2): 3, (2, 1): 4, (2, 3): 2} -+ {(2, 3): 2, (1, 2): 3, (2, 1): 4} - """ - return self.__repn.copy() - -diff --git a/src/sage/rings/polynomial/polynomial_element_generic.py b/src/sage/rings/polynomial/polynomial_element_generic.py -index 7319ae5544..a8b6d5bc82 100644 ---- a/src/sage/rings/polynomial/polynomial_element_generic.py -+++ b/src/sage/rings/polynomial/polynomial_element_generic.py -@@ -338,7 +338,7 @@ class Polynomial_generic_sparse(Polynomial): - sage: f = w^15 - w*3; f - w^15 - 3*w - sage: d = f._dict_unsafe(); d -- {1: -3, 15: 1} -+ {15: 1, 1: -3} - sage: d[1] = 10; f - w^15 + 10*w - """ -diff --git a/src/sage/rings/polynomial/polynomial_ring.py b/src/sage/rings/polynomial/polynomial_ring.py -index f19e94c766..ecdfe8f66e 100644 ---- a/src/sage/rings/polynomial/polynomial_ring.py -+++ b/src/sage/rings/polynomial/polynomial_ring.py -@@ -1201,7 +1201,7 @@ class PolynomialRing_general(sage.algebras.algebra.Algebra): - - sage: R.<y,x,a42> = RR[] - sage: R.gens_dict() -- {'a42': a42, 'x': x, 'y': y} -+ {'y': y, 'x': x, 'a42': a42} - """ - gens = self.gens() - names = self.variable_names() -diff --git a/src/sage/rings/ring_extension.pyx b/src/sage/rings/ring_extension.pyx -index 754b8c2ca6..eef5fe247a 100644 ---- a/src/sage/rings/ring_extension.pyx -+++ b/src/sage/rings/ring_extension.pyx -@@ -377,10 +377,12 @@ class RingExtensionFactory(UniqueFactory): - ((Ring morphism: - From: Integer Ring - To: Rational Field -- Defn: 1 |--> 1, (), ()), -- {'constructors': [(<type 'sage.rings.ring_extension.RingExtension_generic'>, -- {'is_backend_exposed': True, -- 'print_options': {'print_elements_as': None, 'print_parent_as': None}})]}) -+ Defn: 1 |--> 1, -+ (), -+ ()), -+ {'constructors': [(<class 'sage.rings.ring_extension.RingExtension_generic'>, -+ {'print_options': {'print_parent_as': None, 'print_elements_as': None}, -+ 'is_backend_exposed': True})]}) - - sage: RingExtension.create_key_and_extra_args(GF(5^4), GF(5^2), names=('a',)) - ((Ring morphism: -@@ -388,7 +390,7 @@ class RingExtensionFactory(UniqueFactory): - To: Finite Field in z4 of size 5^4 - Defn: z2 |--> z4^3 + z4^2 + z4 + 3, (z4,), ('a',)), - {'constructors': [(<type 'sage.rings.ring_extension.RingExtensionWithGen'>, -- {'gen': z4, 'is_backend_exposed': True, 'names': ('a',)})]}) -+ {'gen': z4, 'names': ('a',), 'is_backend_exposed': True})]}) - """ - use_generic_constructor = True - is_backend_exposed = True -diff --git a/src/sage/rings/tate_algebra_element.pyx b/src/sage/rings/tate_algebra_element.pyx -index 6a293fff3d..d438e8f25c 100644 ---- a/src/sage/rings/tate_algebra_element.pyx -+++ b/src/sage/rings/tate_algebra_element.pyx -@@ -2227,7 +2227,7 @@ cdef class TateAlgebraElement(CommutativeAlgebraElement): - sage: A.<x,y> = TateAlgebra(R) - sage: f = 2*x^2 + x - sage: f.dict() -- {(1, 0): ...0000000001, (2, 0): ...00000000010} -+ {(2, 0): ...00000000010, (1, 0): ...0000000001} - - """ - self._normalize() -diff --git a/src/sage/sandpiles/examples.py b/src/sage/sandpiles/examples.py -index eb38b71170..e08a1f1787 100644 ---- a/src/sage/sandpiles/examples.py -+++ b/src/sage/sandpiles/examples.py -@@ -200,7 +200,7 @@ class SandpileExamples(object): - [1, 1, 1, 1, 1, 2415] - sage: s = sandpiles.Grid(1,1) - sage: s.dict() -- {(0, 0): {(1, 1): 4}, (1, 1): {(0, 0): 4}} -+ {(1, 1): {(0, 0): 4}, (0, 0): {(1, 1): 4}} - """ - G = graphs.Grid2dGraph(m+2,n+2) - G.allow_multiple_edges(True) # to ensure each vertex ends up with degree 4 -diff --git a/src/sage/sandpiles/sandpile.py b/src/sage/sandpiles/sandpile.py -index eca470cc59..6acb1f95c0 100644 ---- a/src/sage/sandpiles/sandpile.py -+++ b/src/sage/sandpiles/sandpile.py -@@ -264,7 +264,7 @@ Working with sandpile divisors:: - sage: D.is_linearly_equivalent(E) - True - sage: D.q_reduced() -- {0: 4, 1: 0, 2: 0, 3: 1} -+ {1: 0, 2: 0, 3: 1, 0: 4} - sage: S = sandpiles.Complete(4) - sage: D = SandpileDivisor(S, [0,0,0,5]) - sage: E = D.stabilize(); E -@@ -272,7 +272,7 @@ Working with sandpile divisors:: - sage: D.is_linearly_equivalent(E) - True - sage: D.q_reduced() -- {0: 4, 1: 0, 2: 0, 3: 1} -+ {1: 0, 2: 0, 3: 1, 0: 4} - sage: D.rank() - 2 - sage: sorted(D.effective_div(), key=str) -@@ -548,7 +548,7 @@ class Sandpile(DiGraph): - [-1 -2 3 0] - [ 0 0 0 0] - sage: s.dict() -- {0: {1: 1, 2: 1, 3: 1}, 1: {0: 1, 1: 1, 2: 3}, 2: {0: 1, 1: 2, 2: 4}} -+ {0: {1: 1, 2: 1, 3: 1}, 1: {0: 1, 1: 1, 2: 3}, 2: {1: 2, 0: 1, 2: 4}} - - Sandpiles can be created from Graphs and DiGraphs. :: - -@@ -1976,13 +1976,13 @@ class Sandpile(DiGraph): - - sage: S = Sandpile({0:[1], 2:[0,1], 1:[2]}) - sage: S.dict() -- {0: {1: 1}, 1: {2: 1}, 2: {0: 1, 1: 1}} -+ {0: {1: 1}, 2: {0: 1, 1: 1}, 1: {2: 1}} - sage: T = S.reorder_vertices() - - The vertices 1 and 2 have been swapped:: - - sage: T.dict() -- {0: {1: 1}, 1: {0: 1, 2: 1}, 2: {0: 1}} -+ {2: {0: 1}, 1: {2: 1, 0: 1}, 0: {1: 1}} - """ - - # first order the vertices according to their distance from the sink -@@ -2077,7 +2077,7 @@ class Sandpile(DiGraph): - sage: s.group_order() - 28 - sage: s.jacobian_representatives() -- [{0: -5, 1: 3, 2: 2}, {0: -4, 1: 3, 2: 1}] -+ [{1: 3, 2: 2, 0: -5}, {1: 3, 2: 1, 0: -4}] - - Let `\tau` be the nonnegative generator of the kernel of the transpose of - the Laplacian, and let `tau_s` be it sink component, then the sandpile -@@ -2425,7 +2425,8 @@ class Sandpile(DiGraph): - sage: S = Sandpile({0:{},1:{0: 1, 2: 1, 3: 4},2:{3: 5},3:{1: 1, 2: 1}},0) - sage: p = S.betti_complexes() - sage: p[0] -- [{0: -8, 1: 5, 2: 4, 3: 1}, Simplicial complex with vertex set (1, 2, 3) and facets {(3,), (1, 2)}] -+ [{1: 5, 2: 4, 3: 1, 0: -8}, -+ Simplicial complex with vertex set (1, 2, 3) and facets {(3,), (1, 2)}] - sage: S.resolution() - 'R^1 <-- R^5 <-- R^5 <-- R^1' - sage: S.betti() -@@ -3003,9 +3004,9 @@ class SandpileConfig(dict): - sage: c.equivalent_recurrent() - {1: 1, 2: 1} - sage: c.__dict__ -- {'_equivalent_recurrent': [{1: 1, 2: 1}, {1: 2, 2: 1}], -- '_sandpile': Cycle sandpile graph: 3 vertices, sink = 0, -- '_vertices': [1, 2]} -+ {'_sandpile': Cycle sandpile graph: 3 vertices, sink = 0, -+ '_vertices': [1, 2], -+ '_equivalent_recurrent': [{1: 1, 2: 1}, {1: 2, 2: 1}]} - - .. NOTE:: - -@@ -4323,12 +4324,12 @@ class SandpileDivisor(dict): - sage: D = SandpileDivisor(S,[0,1,1]) - sage: eff = D.effective_div() - sage: D.__dict__ -- {'_effective_div': [{0: 0, 1: 1, 2: 1}, {0: 2, 1: 0, 2: 0}], -+ {'_sandpile': Cycle sandpile graph: 3 vertices, sink = 0, -+ '_vertices': [0, 1, 2], -+ '_weierstrass_rank_seq': {}, - '_polytope': A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 3 vertices, - '_polytope_integer_pts': ((0, 0), (1, 1)), -- '_sandpile': Cycle sandpile graph: 3 vertices, sink = 0, -- '_vertices': [0, 1, 2], -- '_weierstrass_rank_seq': {}} -+ '_effective_div': [{0: 0, 1: 1, 2: 1}, {0: 2, 1: 0, 2: 0}]} - sage: D[0] += 1 - sage: D.__dict__ - {'_sandpile': Cycle sandpile graph: 3 vertices, sink = 0, -@@ -4925,7 +4926,7 @@ class SandpileDivisor(dict): - sage: s = sandpiles.Complete(4) - sage: D = SandpileDivisor(s,[2,-3,2,0]) - sage: D.q_reduced() -- {0: -2, 1: 1, 2: 2, 3: 0} -+ {1: 1, 2: 2, 3: 0, 0: -2} - sage: D.q_reduced(False) - [-2, 1, 2, 0] - -@@ -6357,13 +6358,13 @@ def glue_graphs(g, h, glue_g, glue_h): - sage: glue_y = {0: 1, 1: 2, 3: 1} - sage: z = glue_graphs(x,y,glue_x,glue_y); z - {'sink': {}, -- 'x0': {'sink': 1, 'x1': 1, 'x3': 2, 'y1': 2, 'y3': 1}, - 'x1': {'x0': 1}, - 'x2': {'x0': 1, 'x1': 1}, - 'x3': {'x0': 1, 'x1': 1, 'x2': 1}, - 'y1': {'sink': 2}, - 'y2': {'y1': 2}, -- 'y3': {'sink': 1, 'y2': 1}} -+ 'y3': {'sink': 1, 'y2': 1}, -+ 'x0': {'x1': 1, 'x3': 2, 'sink': 1, 'y1': 2, 'y3': 1}} - sage: S = Sandpile(z,'sink') - sage: S.h_vector() - [1, 6, 17, 31, 41, 41, 31, 17, 6, 1] -diff --git a/src/sage/schemes/elliptic_curves/cm.py b/src/sage/schemes/elliptic_curves/cm.py -index e66c819b59..fb16b84d2f 100644 ---- a/src/sage/schemes/elliptic_curves/cm.py -+++ b/src/sage/schemes/elliptic_curves/cm.py -@@ -461,7 +461,67 @@ def discriminants_with_bounded_class_number(hmax, B=None, proof=None): - Find all class numbers for discriminant up to 50:: - - sage: sage.schemes.elliptic_curves.cm.discriminants_with_bounded_class_number(hmax=5, B=50) -- {1: [(-3, 3), (-3, 2), (-3, 1), (-4, 2), (-4, 1), (-7, 2), (-7, 1), (-8, 1), (-11, 1), (-19, 1), (-43, 1)], 2: [(-3, 7), (-3, 5), (-3, 4), (-4, 5), (-4, 4), (-4, 3), (-7, 4), (-8, 3), (-8, 2), (-11, 3), (-15, 2), (-15, 1), (-20, 1), (-24, 1), (-35, 1), (-40, 1)], 3: [(-3, 9), (-3, 6), (-11, 2), (-19, 2), (-23, 2), (-23, 1), (-31, 2), (-31, 1), (-43, 2)], 4: [(-3, 13), (-3, 11), (-3, 8), (-4, 10), (-4, 8), (-4, 7), (-4, 6), (-7, 8), (-7, 6), (-7, 3), (-8, 6), (-8, 4), (-11, 5), (-15, 4), (-19, 5), (-19, 3), (-20, 3), (-20, 2), (-24, 2), (-35, 3), (-39, 2), (-39, 1), (-40, 2), (-43, 3)], 5: [(-47, 2), (-47, 1)]} -+ {5: [(-47, 2), (-47, 1)], -+ 1: [(-3, 3), -+ (-3, 2), -+ (-3, 1), -+ (-4, 2), -+ (-4, 1), -+ (-7, 2), -+ (-7, 1), -+ (-8, 1), -+ (-11, 1), -+ (-19, 1), -+ (-43, 1)], -+ 3: [(-3, 9), -+ (-3, 6), -+ (-11, 2), -+ (-19, 2), -+ (-23, 2), -+ (-23, 1), -+ (-31, 2), -+ (-31, 1), -+ (-43, 2)], -+ 4: [(-3, 13), -+ (-3, 11), -+ (-3, 8), -+ (-4, 10), -+ (-4, 8), -+ (-4, 7), -+ (-4, 6), -+ (-7, 8), -+ (-7, 6), -+ (-7, 3), -+ (-8, 6), -+ (-8, 4), -+ (-11, 5), -+ (-15, 4), -+ (-19, 5), -+ (-19, 3), -+ (-20, 3), -+ (-20, 2), -+ (-24, 2), -+ (-35, 3), -+ (-39, 2), -+ (-39, 1), -+ (-40, 2), -+ (-43, 3)], -+ 2: [(-3, 7), -+ (-3, 5), -+ (-3, 4), -+ (-4, 5), -+ (-4, 4), -+ (-4, 3), -+ (-7, 4), -+ (-8, 3), -+ (-8, 2), -+ (-11, 3), -+ (-15, 2), -+ (-15, 1), -+ (-20, 1), -+ (-24, 1), -+ (-35, 1), -+ (-40, 1)]} - """ - # imports that are needed only for this function - from sage.structure.proof.proof import get_flag -diff --git a/src/sage/schemes/hyperelliptic_curves/invariants.py b/src/sage/schemes/hyperelliptic_curves/invariants.py -index 4274bd90cc..09a620f745 100644 ---- a/src/sage/schemes/hyperelliptic_curves/invariants.py -+++ b/src/sage/schemes/hyperelliptic_curves/invariants.py -@@ -149,42 +149,42 @@ def ubs(f): - sage: from sage.schemes.hyperelliptic_curves.invariants import ubs - sage: x = QQ['x'].0 - sage: ubs(x^6 + 1) -- {'A': 2, -- 'B': 2/3, -- 'C': -2/9, -- 'D': 0, -- 'Delta': -2/3*x^2*h^2, -- 'f': x^6 + h^6, -+ {'f': x^6 + h^6, - 'i': 2*x^2*h^2, -+ 'Delta': -2/3*x^2*h^2, - 'y1': 0, - 'y2': 0, -- 'y3': 0} -+ 'y3': 0, -+ 'A': 2, -+ 'B': 2/3, -+ 'C': -2/9, -+ 'D': 0} - - sage: R.<u, v> = QQ[] - sage: ubs(u^6 + v^6) -- {'A': 2, -- 'B': 2/3, -- 'C': -2/9, -- 'D': 0, -- 'Delta': -2/3*u^2*v^2, -- 'f': u^6 + v^6, -+ {'f': u^6 + v^6, - 'i': 2*u^2*v^2, -+ 'Delta': -2/3*u^2*v^2, - 'y1': 0, - 'y2': 0, -- 'y3': 0} -+ 'y3': 0, -+ 'A': 2, -+ 'B': 2/3, -+ 'C': -2/9, -+ 'D': 0} - - sage: R.<t> = GF(31)[] - sage: ubs(t^6 + 2*t^5 + t^2 + 3*t + 1) -- {'A': 0, -- 'B': -12, -- 'C': -15, -- 'D': -15, -- 'Delta': -10*t^4 + 12*t^3*h + 7*t^2*h^2 - 5*t*h^3 + 2*h^4, -- 'f': t^6 + 2*t^5*h + t^2*h^4 + 3*t*h^5 + h^6, -+ {'f': t^6 + 2*t^5*h + t^2*h^4 + 3*t*h^5 + h^6, - 'i': -4*t^4 + 10*t^3*h + 2*t^2*h^2 - 9*t*h^3 - 7*h^4, -+ 'Delta': -10*t^4 + 12*t^3*h + 7*t^2*h^2 - 5*t*h^3 + 2*h^4, - 'y1': 4*t^2 - 10*t*h - 13*h^2, - 'y2': 6*t^2 - 4*t*h + 2*h^2, -- 'y3': 4*t^2 - 4*t*h - 9*h^2} -+ 'y3': 4*t^2 - 4*t*h - 9*h^2, -+ 'A': 0, -+ 'B': -12, -+ 'C': -15, -+ 'D': -15} - """ - ub = Ueberschiebung - if f.parent().ngens() == 1: -diff --git a/src/sage/schemes/projective/projective_space.py b/src/sage/schemes/projective/projective_space.py -index 2a2916ef49..aad6e0f280 100644 ---- a/src/sage/schemes/projective/projective_space.py -+++ b/src/sage/schemes/projective/projective_space.py -@@ -1823,13 +1823,13 @@ class ProjectiveSpace_finite_field(ProjectiveSpace_field): - sage: P1 = ProjectiveSpace(GF(7),1,'x') - sage: P1.rational_points_dictionary() - {(0 : 1): 0, -- (1 : 0): 7, - (1 : 1): 1, - (2 : 1): 2, - (3 : 1): 3, - (4 : 1): 4, - (5 : 1): 5, -- (6 : 1): 6} -+ (6 : 1): 6, -+ (1 : 0): 7} - """ - n = self.dimension_relative() - R = self.base_ring() -diff --git a/src/sage/schemes/riemann_surfaces/riemann_surface.py b/src/sage/schemes/riemann_surfaces/riemann_surface.py -index ef5fcf50e0..505c0a5aa5 100644 ---- a/src/sage/schemes/riemann_surfaces/riemann_surface.py -+++ b/src/sage/schemes/riemann_surfaces/riemann_surface.py -@@ -1011,17 +1011,17 @@ class RiemannSurface(object): - (1, 2): (), - (1, 3): (0,1), - (1, 6): (), -- (2, 0): (), -- (2, 1): (), - (2, 5): (0,1), -- (3, 1): (0,1), - (3, 4): (), -- (4, 0): (), -- (4, 3): (), -- (5, 2): (0,1), - (5, 7): (), -- (6, 1): (), - (6, 7): (), -+ (2, 0): (), -+ (4, 0): (), -+ (2, 1): (), -+ (3, 1): (0,1), -+ (6, 1): (), -+ (5, 2): (0,1), -+ (4, 3): (), - (7, 5): (), - (7, 6): ()} - """ -diff --git a/src/sage/schemes/toric/morphism.py b/src/sage/schemes/toric/morphism.py -index d2cee6fe37..ef9c475752 100644 ---- a/src/sage/schemes/toric/morphism.py -+++ b/src/sage/schemes/toric/morphism.py -@@ -586,7 +586,7 @@ class SchemeMorphism_orbit_closure_toric_variety(SchemeMorphism, Morphism): - TESTS:: - - sage: V.embedding_morphism()._reverse_ray_map() -- {N(-1): 3, N(1): 2} -+ {N(1): 2, N(-1): 3} - sage: V.embedding_morphism()._defining_cone - 1-d cone of Rational polyhedral fan in 2-d lattice N - """ -@@ -646,9 +646,9 @@ class SchemeMorphism_orbit_closure_toric_variety(SchemeMorphism, Morphism): - sage: P1 = P2_112.orbit_closure(Cone([(1,0)])) - sage: f = P1.embedding_morphism() - sage: f._ray_map -- {N(-1, -2): (-2), N(0, 1): (1), N(1, 0): (0)} -+ {N(0, 1): (1), N(1, 0): (0), N(-1, -2): (-2)} - sage: f._reverse_ray_map() -- {N(-2): 2, N(1): 1} -+ {N(1): 1, N(-2): 2} - """ - orbit = self.parent().domain() - codomain_fan = self.parent().codomain().fan() -@@ -1814,7 +1814,7 @@ class SchemeMorphism_fan_fiber_component_toric_variety(SchemeMorphism): - sage: fc = P1xP1.hom(matrix([[1],[0]]), P1).fiber_component(Cone([(1,0)])) - sage: f = fc.embedding_morphism() - sage: f._ray_index_map # indirect doctest -- {N(-1): 3, N(1): 2} -+ {N(1): 2, N(-1): 3} - - TESTS:: - -@@ -1954,7 +1954,7 @@ class SchemeMorphism_fan_fiber_component_toric_variety(SchemeMorphism): - N(1, -3) (9, 2) - N(-1, 2) (11, 1) - sage: f._ray_index_map -- {N(-3, 4): 10, N(-1, 2): 11, N(0, 1): 5, N(1, 0): 4, N(2, -6): 9} -+ {N(2, -6): 9, N(-3, 4): 10, N(0, 1): 5, N(1, 0): 4, N(-1, 2): 11} - """ - try: - image_ray_index = self._ray_index_map[fiber_ray] -diff --git a/src/sage/schemes/toric/weierstrass.py b/src/sage/schemes/toric/weierstrass.py -index 3f93cccd24..5ce45b0dcc 100644 ---- a/src/sage/schemes/toric/weierstrass.py -+++ b/src/sage/schemes/toric/weierstrass.py -@@ -258,16 +258,16 @@ def Newton_polytope_vars_coeffs(polynomial, variables): - sage: p = (a30*x^3 + a21*x^2*y + a12*x*y^2 + a03*y^3 + a20*x^2*z + - ....: a11*x*y*z + a02*y^2*z + a10*x*z^2 + a01*y*z^2 + a00*z^3) - sage: p_data = Newton_polytope_vars_coeffs(p, [x,y,z]); p_data -- {(0, 0, 3): a00, -- (0, 1, 2): a01, -- (0, 2, 1): a02, -- (0, 3, 0): a03, -- (1, 0, 2): a10, -- (1, 1, 1): a11, -+ {(3, 0, 0): a30, -+ (2, 1, 0): a21, - (1, 2, 0): a12, -+ (0, 3, 0): a03, - (2, 0, 1): a20, -- (2, 1, 0): a21, -- (3, 0, 0): a30} -+ (1, 1, 1): a11, -+ (0, 2, 1): a02, -+ (1, 0, 2): a10, -+ (0, 1, 2): a01, -+ (0, 0, 3): a00} - - sage: from sage.geometry.polyhedron.ppl_lattice_polytope import LatticePolytope_PPL - sage: polytope = LatticePolytope_PPL(list(p_data)); polytope -diff --git a/src/sage/sets/finite_set_map_cy.pyx b/src/sage/sets/finite_set_map_cy.pyx -index cb1f7bff7f..6d606af5aa 100644 ---- a/src/sage/sets/finite_set_map_cy.pyx -+++ b/src/sage/sets/finite_set_map_cy.pyx -@@ -311,7 +311,7 @@ cdef class FiniteSetMap_MN(ClonableIntArray): - EXAMPLES:: - - sage: FiniteSetMaps(4, 3)([1, 0, 2, 1]).fibers() -- {0: {1}, 1: {0, 3}, 2: {2}} -+ {1: {0, 3}, 0: {1}, 2: {2}} - sage: F = FiniteSetMaps(["a", "b", "c"]) - sage: F.from_dict({"a": "b", "b": "a", "c": "b"}).fibers() == {'a': {'b'}, 'b': {'a', 'c'}} - True -diff --git a/src/sage/structure/element.pyx b/src/sage/structure/element.pyx -index a5fbd555f2..587b055dcf 100644 ---- a/src/sage/structure/element.pyx -+++ b/src/sage/structure/element.pyx -@@ -537,8 +537,8 @@ cdef class Element(SageObject): - sage: i = ideal(x^2 - y^2 + 1) - sage: i.__getstate__() - (Monoid of ideals of Multivariate Polynomial Ring in x, y over Rational Field, -- {'_Ideal_generic__gens': (x^2 - y^2 + 1,), -- '_Ideal_generic__ring': Multivariate Polynomial Ring in x, y over Rational Field, -+ {'_Ideal_generic__ring': Multivariate Polynomial Ring in x, y over Rational Field, -+ '_Ideal_generic__gens': (x^2 - y^2 + 1,), - '_gb_by_ordering': {}}) - """ - return (self._parent, self.__dict__) -diff --git a/src/sage/structure/global_options.py b/src/sage/structure/global_options.py -index d5a85c8394..4d2ea30597 100644 ---- a/src/sage/structure/global_options.py -+++ b/src/sage/structure/global_options.py -@@ -1314,9 +1314,9 @@ class GlobalOptions(metaclass=GlobalOptionsMeta): - - sage: Partitions.options._reset() - sage: Partitions.options.__getstate__() -- {'convention': 'English', -- 'option_class': 'Partitions', -- 'options_module': 'sage.combinat.partition'} -+ {'option_class': 'Partitions', -+ 'options_module': 'sage.combinat.partition', -+ 'convention': 'English'} - """ - - # options classes can be pickled only if they are the options for an -diff --git a/src/sage/structure/indexed_generators.py b/src/sage/structure/indexed_generators.py -index e2322b7ec5..9ad32fc0a0 100644 ---- a/src/sage/structure/indexed_generators.py -+++ b/src/sage/structure/indexed_generators.py -@@ -555,7 +555,7 @@ def parse_indices_names(names, index_set, prefix, kwds={}): - sage: parse_indices_names('x,y,z', None, None, d) - (('x', 'y', 'z'), {'x', 'y', 'z'}, '') - sage: d -- {'bracket': False, 'string_quotes': False} -+ {'string_quotes': False, 'bracket': False} - sage: d = {} - sage: parse_indices_names(None, ZZ, None, d) - (None, Integer Ring, None) -@@ -568,11 +568,11 @@ def parse_indices_names(names, index_set, prefix, kwds={}): - sage: parse_indices_names(['a','b','c'], ZZ, 'x', d) - (('a', 'b', 'c'), Integer Ring, 'x') - sage: d -- {'bracket': '[', 'string_quotes': True} -+ {'string_quotes': True, 'bracket': '['} - sage: parse_indices_names('x,y,z', None, 'A', d) - (('x', 'y', 'z'), {'x', 'y', 'z'}, 'A') - sage: d -- {'bracket': '[', 'string_quotes': True} -+ {'string_quotes': True, 'bracket': '['} - """ - if index_set is None: - if names is None: -diff --git a/src/sage/structure/proof/all.py b/src/sage/structure/proof/all.py -index 15d8799cb2..af91cd70f4 100644 ---- a/src/sage/structure/proof/all.py -+++ b/src/sage/structure/proof/all.py -@@ -219,8 +219,8 @@ def all(t=None): - 'elliptic_curve': True, - 'linear_algebra': True, - 'number_field': True, -- 'other': True, -- 'polynomial': True} -+ 'polynomial': True, -+ 'other': True} - sage: proof.number_field(False) - sage: proof.number_field() - False -@@ -229,8 +229,8 @@ def all(t=None): - 'elliptic_curve': True, - 'linear_algebra': True, - 'number_field': False, -- 'other': True, -- 'polynomial': True} -+ 'polynomial': True, -+ 'other': True} - sage: proof.number_field(True) - sage: proof.number_field() - True -diff --git a/src/sage/structure/set_factories.py b/src/sage/structure/set_factories.py -index f87bc88dbe..a042684db8 100644 ---- a/src/sage/structure/set_factories.py -+++ b/src/sage/structure/set_factories.py -@@ -482,8 +482,8 @@ class SetFactoryPolicy(UniqueRepresentation, SageObject): - sage: from sage.structure.set_factories_example import XYPairs, XYPair - sage: pol = XYPairs._default_policy - sage: pol.self_element_constructor_attributes(XYPair) -- {'Element': <class 'sage.structure.set_factories_example.XYPair'>, -- '_parent_for': 'self'} -+ {'_parent_for': 'self', -+ 'Element': <class 'sage.structure.set_factories_example.XYPair'>} - """ - return {'_parent_for': "self", 'Element': Element} - -@@ -503,8 +503,8 @@ class SetFactoryPolicy(UniqueRepresentation, SageObject): - sage: from sage.structure.set_factories_example import XYPairs, XYPair - sage: pol = XYPairs._default_policy - sage: pol.facade_element_constructor_attributes(XYPairs()) -- {'_facade_for': AllPairs, -- '_parent_for': AllPairs, -+ {'_parent_for': AllPairs, -+ '_facade_for': AllPairs, - 'element_class': <class 'sage.structure.set_factories_example.AllPairs_with_category.element_class'>} - """ - return {'_parent_for': parent, -@@ -533,11 +533,11 @@ class SetFactoryPolicy(UniqueRepresentation, SageObject): - sage: from sage.structure.set_factories_example import XYPairs, XYPair - sage: pol = XYPairs._default_policy - sage: pol.element_constructor_attributes(()) -- {'Element': <class 'sage.structure.set_factories_example.XYPair'>, -- '_parent_for': 'self'} -+ {'_parent_for': 'self', -+ 'Element': <class 'sage.structure.set_factories_example.XYPair'>} - sage: pol.element_constructor_attributes((1)) -- {'_facade_for': AllPairs, -- '_parent_for': AllPairs, -+ {'_parent_for': AllPairs, -+ '_facade_for': AllPairs, - 'element_class': <class 'sage.structure.set_factories_example.AllPairs_with_category.element_class'>} - """ - -@@ -600,8 +600,8 @@ class SelfParentPolicy(SetFactoryPolicy): - sage: from sage.structure.set_factories_example import XYPairs, XYPair - sage: pol = SelfParentPolicy(XYPairs, XYPair) - sage: pol.element_constructor_attributes(()) -- {'Element': <class 'sage.structure.set_factories_example.XYPair'>, -- '_parent_for': 'self'} -+ {'_parent_for': 'self', -+ 'Element': <class 'sage.structure.set_factories_example.XYPair'>} - """ - return self.self_element_constructor_attributes(self._Element) - -@@ -667,11 +667,11 @@ class TopMostParentPolicy(SetFactoryPolicy): - sage: from sage.structure.set_factories_example import XYPairs, XYPair - sage: pol = TopMostParentPolicy(XYPairs, (), XYPair) - sage: pol.element_constructor_attributes(()) -- {'Element': <class 'sage.structure.set_factories_example.XYPair'>, -- '_parent_for': 'self'} -+ {'_parent_for': 'self', -+ 'Element': <class 'sage.structure.set_factories_example.XYPair'>} - sage: pol.element_constructor_attributes((1)) -- {'_facade_for': AllPairs, -- '_parent_for': AllPairs, -+ {'_parent_for': AllPairs, -+ '_facade_for': AllPairs, - 'element_class': <class 'sage.structure.set_factories_example.AllPairs_with_category.element_class'>} - """ - factory = self._factory -@@ -768,12 +768,12 @@ class FacadeParentPolicy(SetFactoryPolicy): - sage: from sage.structure.set_factories_example import XYPairs, XYPair - sage: pol = FacadeParentPolicy(XYPairs, XYPairs()) - sage: pol.element_constructor_attributes(()) -- {'_facade_for': AllPairs, -- '_parent_for': AllPairs, -+ {'_parent_for': AllPairs, -+ '_facade_for': AllPairs, - 'element_class': <class 'sage.structure.set_factories_example.AllPairs_with_category.element_class'>} - sage: pol.element_constructor_attributes((1)) -- {'_facade_for': AllPairs, -- '_parent_for': AllPairs, -+ {'_parent_for': AllPairs, -+ '_facade_for': AllPairs, - 'element_class': <class 'sage.structure.set_factories_example.AllPairs_with_category.element_class'>} - """ - return self.facade_element_constructor_attributes( -diff --git a/src/sage/structure/unique_representation.py b/src/sage/structure/unique_representation.py -index 75d963e0ef..17c0d668f3 100644 ---- a/src/sage/structure/unique_representation.py -+++ b/src/sage/structure/unique_representation.py -@@ -858,7 +858,7 @@ class CachedRepresentation(metaclass=ClasscallMetaclass): - arguments in the instance dictionary upon construction:: - - sage: x.__dict__ -- {'_reduction': (<class '__main__.MyClass'>, (), {'value': 1}), 'value': 1} -+ {'value': 1, '_reduction': (<class '__main__.MyClass'>, (), {'value': 1})} - - It is often easy in a derived subclass to reconstruct the constructor's - arguments from the instance data structure. When this is the case, -diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/graphtheory_doctest.py b/src/sage/tests/books/computational-mathematics-with-sagemath/graphtheory_doctest.py -index c76b2f7de7..9464e1422a 100644 ---- a/src/sage/tests/books/computational-mathematics-with-sagemath/graphtheory_doctest.py -+++ b/src/sage/tests/books/computational-mathematics-with-sagemath/graphtheory_doctest.py -@@ -149,10 +149,10 @@ Sage example in ./graphtheory.tex, line 597:: - Sage example in ./graphtheory.tex, line 608:: - - sage: C.coloring(hex_colors = True) -- {'#00ffff': [3, 8, 5], -- '#7f00ff': [11], -+ {'#ff0000': [0, 2, 7, 10], - '#7fff00': [1, 4, 6, 9], -- '#ff0000': [0, 2, 7, 10]} -+ '#00ffff': [3, 8, 5], -+ '#7f00ff': [11]} - sage: C.show(vertex_colors = C.coloring(hex_colors = True)) - - Sage example in ./graphtheory.tex, line 644:: |