summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Rojas2020-04-14 21:34:14 +0000
committerAntonio Rojas2020-04-14 21:34:14 +0000
commit4beae3c9cd3c6da4bb0c019d09cc78c3eec791e2 (patch)
treea764b391e86b48d5eb31538e4cfb93f5f940cfa5
parent4f2038b18c028911646bbe84ca646f10e2ea2f2e (diff)
downloadaur-4beae3c9cd3c6da4bb0c019d09cc78c3eec791e2.tar.gz
Rebase patches, split dict sorting changes out of ipython7 patch
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD20
-rw-r--r--package.patch2
-rw-r--r--sagemath-gap-4.11.patch4
-rw-r--r--sagemath-ipython7.patch4763
-rw-r--r--sagemath-jedi-0.16.patch21
-rw-r--r--sagemath-no-dict-sorting.patch5150
-rw-r--r--sagemath-pari-2.11.3.patch200
-rw-r--r--sagemath-python-3.8.patch178
-rw-r--r--sagemath-singular-4.1.2.patch63
10 files changed, 5490 insertions, 4929 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3757e19ff2ab..7865fc33e90e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = sagemath-git
pkgdesc = Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab
- pkgver = 9.1.beta9.r0.g6a4580546f
+ pkgver = 9.1.rc0.r0.g10ed24e3ed
pkgrel = 1
url = http://www.sagemath.org
arch = x86_64
@@ -100,6 +100,7 @@ pkgbase = sagemath-git
source = sagemath-cremona.patch
source = sagemath-singular-4.1.2.patch
source = sagemath-ecl-sigfpe.patch
+ source = sagemath-no-dict-sorting.patch
source = sagemath-ipython7.patch
source = sagemath-python-3.8.patch
source = sagemath-pexpect-4.8.patch
@@ -108,19 +109,20 @@ pkgbase = sagemath-git
source = sagemath-pari-2.11.3.patch
source = sagemath-jedi-0.16.patch
sha256sums = SKIP
- sha256sums = 9cbb72a1422416152cedd6849944d3c02a1639642758b470931f9fc5ddf42d22
+ sha256sums = b1112875776635b4f33bc13c8aaedfbbaed8f62a1dac986f7b8faa7565d6abae
sha256sums = 6a5470d7044a50a35a6478f57c19adf72fe54aefebeea8a095915b63f9e219ac
sha256sums = 887b931b0eb3c7fcfcb01ae0cfda9668925ed59740c4134cba13c43dfe0dd088
sha256sums = 937074fa7a8a4e2aba9ea77ec622fe937985a1a9176c48460d51325ee877a4f5
- sha256sums = 7950ba0309d661bc73cc46a929d52fba26849d58769aaba2f046dfec70d963f8
+ sha256sums = 408e193c96a466cfe0134fe44a28e93659916d1d28bd4ea89460aec7fefe8657
sha256sums = e44bbde87f3312548faad75b7383ef21fade55be251ab5804de41cd3842ca8a0
- sha256sums = 38b72ef07cb942b6565685147cf6c5cdba9219746fd1baf2f26a72cafdac8acd
- sha256sums = f812e32718eab0292d726bed386217524dcdae3d4078ce82c66c20d00b9806f7
+ sha256sums = 0ef047e671ddd288e07e9f544f646a9a0bd908accfe6b96dcaf4ee52fa6037e7
+ sha256sums = fc28ca3aa1a656bfb451181d5086b3041238f24bf462cc69626d3cd603a246df
+ sha256sums = e5aa663c7f76d737ea697a805094734ab8e06eab35bbeadcb4dcab89998d7b31
sha256sums = 5e6d1aa34959bd4369bd08a80648a5c7bc2d38e72c97e9a5f986e91f8a7aca07
- sha256sums = d75f551fd942963b0158f5b25cefbecb213c37549375dd2e0f88e1856555fa1e
+ sha256sums = 588d831b44ec28ca18540d5649e8af518500b82431a59542f3daa92d6c3007cd
sha256sums = 979777363001cca87f73128dd4db5f372fc9e4f1079805a20af01df47797468f
- sha256sums = e9c450a30c3f76b05808ece2f40b86f5222cd39563fe7d901712937df28eb4ee
- sha256sums = efb5e8b314b0c29eca79f29d70cd302ef9565813fd331a9f1ecb4ac70f416f94
+ sha256sums = 1f41b35c916df74fc943949ccde1155e59e7bbbee220c845c9afdf4e0f76bfbc
+ sha256sums = 30e15715cdc90639d7cbd34e76bbadae2e6d8bab6241617a386aed9513207b8a
pkgname = sagemath-git
optdepends = cython: to compile cython code
diff --git a/PKGBUILD b/PKGBUILD
index 7f52d8279c31..edd36f3cb024 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,7 +7,7 @@
pkgbase=sagemath-git
pkgname=(sagemath-git sagemath-jupyter-git)
-pkgver=9.1.beta9.r0.g6a4580546f
+pkgver=9.1.rc0.r0.g10ed24e3ed
pkgrel=1
pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
arch=(x86_64)
@@ -41,6 +41,7 @@ source=(git://git.sagemath.org/sage.git#branch=develop
sagemath-cremona.patch
sagemath-singular-4.1.2.patch
sagemath-ecl-sigfpe.patch
+ sagemath-no-dict-sorting.patch
sagemath-ipython7.patch
sagemath-python-3.8.patch
sagemath-pexpect-4.8.patch
@@ -49,19 +50,20 @@ source=(git://git.sagemath.org/sage.git#branch=develop
sagemath-pari-2.11.3.patch
sagemath-jedi-0.16.patch)
sha256sums=('SKIP'
- '9cbb72a1422416152cedd6849944d3c02a1639642758b470931f9fc5ddf42d22'
+ 'b1112875776635b4f33bc13c8aaedfbbaed8f62a1dac986f7b8faa7565d6abae'
'6a5470d7044a50a35a6478f57c19adf72fe54aefebeea8a095915b63f9e219ac'
'887b931b0eb3c7fcfcb01ae0cfda9668925ed59740c4134cba13c43dfe0dd088'
'937074fa7a8a4e2aba9ea77ec622fe937985a1a9176c48460d51325ee877a4f5'
- '7950ba0309d661bc73cc46a929d52fba26849d58769aaba2f046dfec70d963f8'
+ '408e193c96a466cfe0134fe44a28e93659916d1d28bd4ea89460aec7fefe8657'
'e44bbde87f3312548faad75b7383ef21fade55be251ab5804de41cd3842ca8a0'
- '38b72ef07cb942b6565685147cf6c5cdba9219746fd1baf2f26a72cafdac8acd'
- 'f812e32718eab0292d726bed386217524dcdae3d4078ce82c66c20d00b9806f7'
+ '0ef047e671ddd288e07e9f544f646a9a0bd908accfe6b96dcaf4ee52fa6037e7'
+ 'fc28ca3aa1a656bfb451181d5086b3041238f24bf462cc69626d3cd603a246df'
+ 'e5aa663c7f76d737ea697a805094734ab8e06eab35bbeadcb4dcab89998d7b31'
'5e6d1aa34959bd4369bd08a80648a5c7bc2d38e72c97e9a5f986e91f8a7aca07'
- 'd75f551fd942963b0158f5b25cefbecb213c37549375dd2e0f88e1856555fa1e'
+ '588d831b44ec28ca18540d5649e8af518500b82431a59542f3daa92d6c3007cd'
'979777363001cca87f73128dd4db5f372fc9e4f1079805a20af01df47797468f'
- 'e9c450a30c3f76b05808ece2f40b86f5222cd39563fe7d901712937df28eb4ee'
- 'efb5e8b314b0c29eca79f29d70cd302ef9565813fd331a9f1ecb4ac70f416f94')
+ '1f41b35c916df74fc943949ccde1155e59e7bbbee220c845c9afdf4e0f76bfbc'
+ '30e15715cdc90639d7cbd34e76bbadae2e6d8bab6241617a386aed9513207b8a')
pkgver() {
cd sage
@@ -78,6 +80,8 @@ prepare(){
patch -p0 -i ../test-optional.patch
# use correct latte-count binary name
patch -p1 -i ../latte-count.patch
+# Remove dict sorting, it doesn't work with ipython >= 7.10
+ patch -p1 -i ../sagemath-no-dict-sorting.patch
# Python 3.8 support
patch -p1 -i ../sagemath-python-3.8.patch
# Fix expect_peek with pexpect 4.8
diff --git a/package.patch b/package.patch
index 8171cb23c58b..d94b63db64f1 100644
--- a/package.patch
+++ b/package.patch
@@ -15,7 +15,7 @@
extra_compile_args = ["-D_XPG6"]),
--- src/sage/misc/package.py.orig 2014-11-23 15:58:13.000000000 +0100
+++ src/sage/misc/package.py 2015-01-22 20:32:25.651383902 +0100
-@@ -336,7 +336,7 @@
+@@ -358,7 +358,7 @@
Use the framework provided by :mod:`sage.features` to check
whether a library is installed and functional.
"""
diff --git a/sagemath-gap-4.11.patch b/sagemath-gap-4.11.patch
index 01c921f12fa4..072f3ecd11d3 100644
--- a/sagemath-gap-4.11.patch
+++ b/sagemath-gap-4.11.patch
@@ -15,7 +15,7 @@ diff --git a/src/sage/coding/linear_code.py b/src/sage/coding/linear_code.py
index e106498063..b56388830b 100644
--- a/src/sage/coding/linear_code.py
+++ b/src/sage/coding/linear_code.py
-@@ -540,17 +540,17 @@ class AbstractLinearCode(AbstractCode, Module):
+@@ -481,17 +481,17 @@ class AbstractLinearCode(AbstractCode, Module):
0
sage: C = codes.HammingCode(GF(4, 'z'), 3)
sage: C.automorphism_group_gens()
@@ -38,7 +38,7 @@ index e106498063..b56388830b 100644
Defn: z |--> z),
((z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1, z + 1); (), Ring endomorphism of Finite Field in z of size 2^2
Defn: z |--> z)],
-@@ -816,10 +816,10 @@ class AbstractLinearCode(AbstractCode, Module):
+@@ -707,10 +707,10 @@ class AbstractLinearCode(AbstractCode, Module):
sage: C_iso == aut_group_can_label.get_canonical_form()
True
sage: aut_group_can_label.get_autom_gens()
diff --git a/sagemath-ipython7.patch b/sagemath-ipython7.patch
index 82b8ebad9d33..7c7951f2c475 100644
--- a/sagemath-ipython7.patch
+++ b/sagemath-ipython7.patch
@@ -1,3366 +1,3 @@
-diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index d1e8bf7388..557fbb2942 100644
---- a/src/sage/doctest/forker.py
-+++ b/src/sage/doctest/forker.py
-@@ -183,15 +183,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"
-- # 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
--
- # Switch on extra debugging
- from sage.structure.debug_options import debug
- debug.refine_category_hash_check = True
-diff --git a/src/sage/algebras/cluster_algebra.py b/src/sage/algebras/cluster_algebra.py
-index 4054bd5d9a..236b861c8a 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::
-@@ -559,7 +559,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 95e12d460b..26a238725c 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 ff6557068b..1cf0bb41a0 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 f19a7d963e..e6536f5eae 100644
---- a/src/sage/categories/crystals.py
-+++ b/src/sage/categories/crystals.py
-@@ -75,7 +75,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 7b14ee25c1..f4a34aace0 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 f4e8ab21be..932299d749 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 391422bdf5..ef824b9777 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 5eba042a44..02810a5f5f 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::
-
-@@ -988,9 +988,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 0fe756e525..7ba5048a7c 100644
---- a/src/sage/categories/pushout.py
-+++ b/src/sage/categories/pushout.py
-@@ -2387,7 +2387,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 cccb2e94fa..d42383d9db 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 57ef7fb896..db347b9e2f 100644
---- a/src/sage/coding/linear_code.py
-+++ b/src/sage/coding/linear_code.py
-@@ -2677,22 +2677,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:
-
-@@ -2706,11 +2706,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 d5c469050a..c0720a828e 100644
---- a/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py
-+++ b/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py
-@@ -2735,119 +2735,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 afcc1fc669..95161c35a6 100644
---- a/src/sage/combinat/crystals/kirillov_reshetikhin.py
-+++ b/src/sage/combinat/crystals/kirillov_reshetikhin.py
-@@ -1188,11 +1188,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}
-@@ -1944,8 +1944,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]]}
- """
-@@ -1964,8 +1964,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 89f3734bc0..9fdb92ab85 100644
---- a/src/sage/combinat/dyck_word.py
-+++ b/src/sage/combinat/dyck_word.py
-@@ -431,12 +431,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 45f15cdb5c..0a85bf72e8 100644
---- a/src/sage/combinat/finite_state_machine.py
-+++ b/src/sage/combinat/finite_state_machine.py
-@@ -2133,8 +2133,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
- """
-@@ -7221,7 +7220,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)
-
-@@ -15054,7 +15053,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
-@@ -15081,7 +15080,7 @@ class _FSMProcessIteratorEpsilon_(FSMProcessIterator):
- +-- tape at 0, [['c']]
- process (0 branches)
- sage: it.visited_states
-- {1: ['c'], 2: ['']}
-+ {2: [''], 1: ['c']}
-
- TESTS::
-
-@@ -15109,7 +15108,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
-@@ -15133,7 +15132,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)
-@@ -15149,7 +15148,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)
-@@ -15186,8 +15185,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:
-@@ -15205,8 +15203,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:
-@@ -15223,8 +15220,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:
-@@ -15371,9 +15367,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 4feb5b52b3..243412d7d2 100644
---- a/src/sage/combinat/growth.py
-+++ b/src/sage/combinat/growth.py
-@@ -703,7 +703,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
-
-@@ -1358,7 +1358,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] / []
-
-@@ -1382,7 +1382,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] / []
-
-@@ -1390,7 +1390,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]
-
-@@ -1537,14 +1537,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 39dee9914b..1ed6067660 100644
---- a/src/sage/combinat/k_tableau.py
-+++ b/src/sage/combinat/k_tableau.py
-@@ -2910,22 +2910,22 @@ class StrongTableau(ClonableList):
-
- 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)]}
-
-@@ -4421,21 +4421,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 97dcce10ae..a3477f69f1 100644
---- a/src/sage/combinat/matrices/latin.py
-+++ b/src/sage/combinat/matrices/latin.py
-@@ -1101,68 +1101,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)})
- """
-
-@@ -2771,12 +2771,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 b8dc15efab..b25d23bd24 100755
---- a/src/sage/combinat/multiset_partition_into_sets_ordered.py
-+++ b/src/sage/combinat/multiset_partition_into_sets_ordered.py
-@@ -1498,15 +1498,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 47d2379910..cb628b26c8 100644
---- a/src/sage/combinat/parallelogram_polyomino.py
-+++ b/src/sage/combinat/parallelogram_polyomino.py
-@@ -559,16 +559,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': 'black',
-+ 'color_point': 'black',
-+ 'color_bounce_0': 'red',
-+ 'color_bounce_1': 'blue',
-+ 'translation': [0, 0],
- 'rotation': 0,
-- 'scale': 1,
-- 'translation': [0, 0]}
-+ 'mirror': None}
- """
-
-
-@@ -2566,16 +2566,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': 'black',
-+ 'color_point': 'black',
-+ 'color_bounce_0': 'red',
-+ 'color_bounce_1': '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 e6f3b365db..4130afb645 100644
---- a/src/sage/combinat/partition.py
-+++ b/src/sage/combinat/partition.py
-@@ -3766,11 +3766,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 a78798746a..f478e5d043 100644
---- a/src/sage/combinat/partition_tuple.py
-+++ b/src/sage/combinat/partition_tuple.py
-@@ -1684,7 +1684,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 deac1eff88..8192a77461 100644
---- a/src/sage/combinat/posets/posets.py
-+++ b/src/sage/combinat/posets/posets.py
-@@ -4044,7 +4044,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(),
-@@ -7592,60 +7592,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, 12)): 0,
-- ((-1, 0), (0, 14)): 0,
-- ((-1, 0), (0, 16)): 0,
-- ((0, -13), (1, -13)): 1,
-+ {((1, 12), (2, 0)): 0,
-+ ((0, 16), (1, 12)): 0,
-+ ((0, 16), (1, 16)): 1,
-+ ((1, 14), (2, 0)): 0,
- ((0, -13), (1, 12)): 0,
- ((0, -13), (1, 14)): 0,
-+ ((0, -13), (1, -13)): 1,
- ((0, -13), (1, 16)): 0,
-+ ((-1, 0), (0, 16)): 0,
-+ ((-1, 0), (0, -13)): 0,
-+ ((-1, 0), (0, 12)): 0,
-+ ((-1, 0), (0, 14)): 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, 16), (2, 0)): 0,
-+ ((0, 14), (1, 12)): 0,
-+ ((0, 14), (1, 14)): 1}
- 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,
-+ {((0, 2), (1, 2)): 1,
-+ ((0, 5), (1, 5)): 1,
-+ ((1, 6), (2, 0)): 0,
-+ ((0, 8), (1, 8)): 1,
-+ ((1, 3), (2, 0)): 0,
-+ ((1, 9), (2, 0)): 0,
-+ ((0, 1), (1, 1)): 1,
-+ ((0, 7), (1, 7)): 1,
-+ ((0, 7), (1, 5)): 0,
-+ ((1, 2), (2, 0)): 0,
-+ ((0, 4), (1, 4)): 1,
-+ ((0, 4), (1, 3)): 0,
-+ ((0, 4), (1, 2)): 0,
-+ ((0, 4), (1, 1)): 0,
-+ ((1, 5), (2, 0)): 0,
-+ ((1, 8), (2, 0)): 0,
- ((-1, 0), (0, 2)): 0,
-- ((-1, 0), (0, 3)): 0,
-- ((-1, 0), (0, 4)): 0,
-+ ((-1, 0), (0, 9)): 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,
-+ ((-1, 0), (0, 7)): 0,
-+ ((-1, 0), (0, 4)): 0,
-+ ((-1, 0), (0, 3)): 0,
-+ ((1, 1), (2, 0)): 0,
- ((0, 3), (1, 3)): 1,
-- ((0, 4), (1, 1)): 0,
-- ((0, 4), (1, 2)): 0,
-- ((0, 4), (1, 3)): 0,
-- ((0, 4), (1, 4)): 1,
-- ((0, 5), (1, 5)): 1,
-- ((0, 6), (1, 6)): 1,
-- ((0, 7), (1, 5)): 0,
-- ((0, 7), (1, 7)): 1,
-- ((0, 8), (1, 8)): 1,
-- ((0, 9), (1, 1)): 0,
-+ ((0, 3), (1, 2)): 0,
-+ ((0, 3), (1, 1)): 0,
- ((0, 9), (1, 9)): 1,
-- ((1, 1), (2, 0)): 0,
-- ((1, 2), (2, 0)): 0,
-- ((1, 3), (2, 0)): 0,
-+ ((0, 9), (1, 1)): 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, 6), (1, 6)): 1,
-+ ((1, 7), (2, 0)): 0})
-
- 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 ef78e8b4e2..fde60b25b1 100644
---- a/src/sage/combinat/set_partition.py
-+++ b/src/sage/combinat/set_partition.py
-@@ -626,13 +626,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',
-@@ -660,13 +660,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 c52ea6e394..7a7f0da433 100644
---- a/src/sage/combinat/similarity_class_type.py
-+++ b/src/sage/combinat/similarity_class_type.py
-@@ -1593,7 +1593,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 d3c2495e44..5394c31a6c 100644
---- a/src/sage/combinat/symmetric_group_representations.py
-+++ b/src/sage/combinat/symmetric_group_representations.py
-@@ -540,8 +540,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
-@@ -565,8 +565,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 a3bdb3d433..6c2f088db5 100644
---- a/src/sage/combinat/words/finite_word.py
-+++ b/src/sage/combinat/words/finite_word.py
-@@ -4832,9 +4832,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()
- {}
-
-@@ -7109,9 +7109,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 325c33220f..e85700c1d7 100644
---- a/src/sage/combinat/words/suffix_trees.py
-+++ b/src/sage/combinat/words/suffix_trees.py
-@@ -1654,7 +1654,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 0124f776d0..5683ae819e 100644
---- a/src/sage/crypto/mq/sr.py
-+++ b/src/sage/crypto/mq/sr.py
-@@ -1654,49 +1654,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 c308d3ac68..50d43ab275 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 7656a69ce0..d1e8bf7388 100644
---- a/src/sage/doctest/forker.py
-+++ b/src/sage/doctest/forker.py
-@@ -139,7 +139,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
-diff --git a/src/sage/doctest/util.py b/src/sage/doctest/util.py
-index f980982715..0b77d5d84d 100644
---- a/src/sage/doctest/util.py
-+++ b/src/sage/doctest/util.py
-@@ -78,7 +78,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 iteritems(self):
-diff --git a/src/sage/ext/fast_callable.pyx b/src/sage/ext/fast_callable.pyx
-index 7c37796afb..cffcc02d46 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/ppl_lattice_polytope.py b/src/sage/geometry/polyhedron/ppl_lattice_polytope.py
-index 4281de7bf0..8bc045a34b 100644
---- a/src/sage/geometry/polyhedron/ppl_lattice_polytope.py
-+++ b/src/sage/geometry/polyhedron/ppl_lattice_polytope.py
-@@ -1231,15 +1231,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 6f8222d07c..1c94998e15 100644
---- a/src/sage/geometry/triangulation/element.py
-+++ b/src/sage/geometry/triangulation/element.py
-@@ -605,32 +605,32 @@ class Triangulation(Element):
-
- sage: triangulation = polytopes.hypercube(2).triangulate(engine='internal')
- sage: triangulation._boundary_simplex_dictionary()
-- {(0, 1): ((0, 1, 3),),
-- (0, 2): ((0, 2, 3),),
-+ {(1, 3): ((0, 1, 3),),
- (0, 3): ((0, 1, 3), (0, 2, 3)),
-- (1, 3): ((0, 1, 3),),
-- (2, 3): ((0, 2, 3),)}
-+ (0, 1): ((0, 1, 3),),
-+ (2, 3): ((0, 2, 3),),
-+ (0, 2): ((0, 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:
-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 59184ccc9f..04affd2261 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..0dbe75cdad 100755
---- a/src/sage/graphs/centrality.pyx
-+++ b/src/sage/graphs/centrality.pyx
-@@ -854,7 +854,7 @@ 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)
-+ sage: centrality_closeness_random_k(G, 10) # random
- {0: 0.6,
- 1: 0.6,
- 2: 0.6,
-diff --git a/src/sage/graphs/digraph.py b/src/sage/graphs/digraph.py
-index 3f13b3324f..d91600dc2e 100644
---- a/src/sage/graphs/digraph.py
-+++ b/src/sage/graphs/digraph.py
-@@ -2675,7 +2675,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')
-@@ -2720,15 +2720,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 463db9c7a2..c74d942165 100644
---- a/src/sage/graphs/distances_all_pairs.pyx
-+++ b/src/sage/graphs/distances_all_pairs.pyx
-@@ -1417,7 +1417,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)::
-
-@@ -1542,9 +1542,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 8b8c98cb15..6823e13b26 100644
---- a/src/sage/graphs/generic_graph.py
-+++ b/src/sage/graphs/generic_graph.py
-@@ -5211,7 +5211,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: [0, 5], 1: [1, 4], 2: [5, 1], 3: [3, 1], 4: [1, 0], 5: [2, 1], 6: [1, 3]}
-+ {2: [5, 1], 0: [0, 5], 4: [1, 0], 1: [1, 4], 3: [3, 1], 5: [2, 1], 6: [1, 3]}
- """
- deprecation(24494, 'This method is replaced by the method layout. '
- 'Please use layout(layout="planar", save_pos=True) '
-@@ -5265,16 +5265,16 @@ class GenericGraph(GenericGraph_pyx):
-
- sage: g = graphs.PathGraph(10)
- sage: g.layout(layout='planar', save_pos=True, test=True)
-- {0: [0, 8],
-- 1: [6, 2],
-- 2: [8, 1],
-- 3: [6, 1],
-- 4: [1, 0],
-- 5: [5, 2],
-- 6: [2, 2],
-- 7: [2, 3],
-- 8: [1, 5],
-- 9: [2, 4]}
-+ {2: [8, 1],
-+ 0: [0, 8],
-+ 4: [1, 0],
-+ 1: [6, 2],
-+ 3: [6, 1],
-+ 5: [5, 2],
-+ 6: [2, 2],
-+ 7: [2, 3],
-+ 8: [1, 5],
-+ 9: [2, 4]}
- sage: g = graphs.BalancedTree(3, 4)
- sage: pos = g.layout(layout='planar', save_pos=True, test=True)
- sage: pos[0]
-@@ -5283,7 +5283,7 @@ class GenericGraph(GenericGraph_pyx):
- [93, 14]
- sage: g = graphs.CycleGraph(7)
- sage: g.layout(layout='planar', save_pos=True, test=True)
-- {0: [0, 5], 1: [1, 4], 2: [5, 1], 3: [3, 1], 4: [1, 0], 5: [2, 1], 6: [1, 3]}
-+ {2: [5, 1], 0: [0, 5], 4: [1, 0], 1: [1, 4], 3: [3, 1], 5: [2, 1], 6: [1, 3]}
- sage: g = graphs.CompleteGraph(5)
- sage: g.layout(layout='planar', save_pos=True, test=True, set_embedding=True)
- Traceback (most recent call last):
-@@ -5294,9 +5294,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]}
-
- TESTS::
-
-@@ -16511,7 +16511,7 @@ 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::
-
-@@ -16521,7 +16521,7 @@ 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)
-@@ -16531,7 +16531,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]}
-
-@@ -16780,7 +16780,7 @@ 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::
-
-@@ -18906,18 +18906,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), ...],
-- '#00ff00': [((), (3,4), 3), ...],
-- '#ff0000': [((), (2,3), 2), ...]}
-+ {'#ff0000': [((), (2,3), 2), ...],
-+ '#00ff00': [((), (3,4), 3), ...],
-+ '#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), ...],
-- 'green': [((), (3,4), 3), ...],
-- 'red': [((), (2,3), 2), ...]}
-+ {'red': [((), (2,3), 2), ...],
-+ 'green': [((), (3,4), 3), ...],
-+ 'blue': [((), (1,2), 1), ...]}
-
- TESTS:
-
-@@ -19062,8 +19062,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
-@@ -19199,10 +19199,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)})
-@@ -19386,13 +19386,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")
-@@ -19404,15 +19404,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
-
-@@ -23571,7 +23571,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,
-@@ -23581,7 +23581,6 @@ class GenericGraph(GenericGraph_pyx):
- 7: 0.000000000000000,
- 8: 18.6846846846847,
- 9: 0.000000000000000,
-- 10: 20.9819819819820,
- 11: 202.778914049184}
-
-
-@@ -23600,7 +23600,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 bcb9ff1be6..4d0c5ce933 100644
---- a/src/sage/graphs/graph.py
-+++ b/src/sage/graphs/graph.py
-@@ -3820,7 +3820,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):
- ...
-@@ -4103,10 +4103,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 47b93c1f38..7493fd8dd1 100644
---- a/src/sage/graphs/graph_coloring.pyx
-+++ b/src/sage/graphs/graph_coloring.pyx
-@@ -1028,10 +1028,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 c0a182bd41..ff728231e3 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 9cd43d11b4..10ae7c9731 100644
---- a/src/sage/graphs/isgci.py
-+++ b/src/sage/graphs/isgci.py
-@@ -759,7 +759,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()
-@@ -776,12 +776,12 @@ 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..fba9755ff2 100644
---- a/src/sage/graphs/partial_cube.py
-+++ b/src/sage/graphs/partial_cube.py
-@@ -110,7 +110,7 @@ def breadth_first_level_search(G, start):
- EXAMPLES::
-
- sage: H = digraphs.DeBruijn(3,2)
-- sage: list(sage.graphs.partial_cube.breadth_first_level_search(H, '00'))
-+ sage: list(sage.graphs.partial_cube.breadth_first_level_search(H, '00')) # random
- [{'00': {'01', '02'}},
- {'01': {'10', '11', '12'}, '02': {'20', '21', '22'}},
- {'10': set(),
-diff --git a/src/sage/graphs/schnyder.py b/src/sage/graphs/schnyder.py
-index 241288a4de..391317fae5 100644
---- a/src/sage/graphs/schnyder.py
-+++ b/src/sage/graphs/schnyder.py
-@@ -473,7 +473,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: [2, 1], 4: [1, 3], 5: [2, 2], 6: [4, 1]}
-+ {1: [5, 1], 0: [0, 5], 2: [1, 0], 3: [2, 1], 4: [1, 3], 5: [2, 2], 6: [4, 1]}
- """
-
- tree_nodes, (v1, v2, v3) = x
-diff --git a/src/sage/graphs/tutte_polynomial.py b/src/sage/graphs/tutte_polynomial.py
-index 994ed72149..e6e7c50dae 100644
---- a/src/sage/graphs/tutte_polynomial.py
-+++ b/src/sage/graphs/tutte_polynomial.py
-@@ -386,7 +386,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 78602206c2..74cdb272d9 100644
---- a/src/sage/groups/perm_gps/cubegroup.py
-+++ b/src/sage/groups/perm_gps/cubegroup.py
-@@ -691,12 +691,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 36ddf4df38..16d75bf9cd 100644
---- a/src/sage/knots/link.py
-+++ b/src/sage/knots/link.py
-@@ -752,47 +752,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 26fb45b45d..35e16ab81d 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 b492ff467b..ebae8a34c4 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 3bcf99b09a..22c2aec42a 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 a43b3c303c..a35fea6444 100644
---- a/src/sage/matroids/catalog.py
-+++ b/src/sage/matroids/catalog.py
-@@ -725,7 +725,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 acbec4610c..e3942b2c8f 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..10ed71f53e 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 12e060fc88..a6873e7238 100644
---- a/src/sage/matroids/matroid.pyx
-+++ b/src/sage/matroids/matroid.pyx
-@@ -3150,7 +3150,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):
-@@ -3196,7 +3196,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()
-@@ -3986,9 +3986,9 @@ cdef class Matroid(SageObject):
- 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'}))
-+ {5: 'f', 2: 'a', 3: 'd', 0: 'b', 4: 'e', 1: 'c'}))
- sage: M = matroids.named_matroids.Fano()
-- sage: M.has_minor(M, True)
-+ sage: M.has_minor(M, True) # random
- (True,
- (frozenset(),
- frozenset(),
-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 6559327295..7a2bec3b04 100644
---- a/src/sage/modular/arithgroup/arithgroup_perm.py
-+++ b/src/sage/modular/arithgroup/arithgroup_perm.py
-@@ -2388,7 +2388,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 7c48016348..d47fc3fae3 100644
---- a/src/sage/modular/arithgroup/congroup_gammaH.py
-+++ b/src/sage/modular/arithgroup/congroup_gammaH.py
-@@ -595,6 +595,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],
-@@ -612,8 +613,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 dd5332c879..6e3e0589ac 100644
---- a/src/sage/modular/dirichlet.py
-+++ b/src/sage/modular/dirichlet.py
-@@ -2277,7 +2277,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 31131ab220..bc33919835 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -1296,9 +1296,9 @@ class Graphics(WithEqualityById, SageObject):
- sage: kwds = {'f': lambda x: x, 'xmin': 0, 'figsize': [1,1], 'plot_points': (40, 40)}
- 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}
-+ {'f': <function <lambda> at 0x...>,
-+ 'xmin': 0,
-+ 'plot_points': (40, 40)}
- sage: G_kwds
- {'figsize': [1, 1]}
-
-@@ -2244,13 +2244,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:
-@@ -2303,18 +2303,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 8dd68e2fee..895689684b 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.47619047619047666}
- 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.4761904761904765}
- """
- import numpy
-
diff --git a/src/sage/repl/attach.py b/src/sage/repl/attach.py
index 11967fbf96..ccb9c4e0c0 100644
--- a/src/sage/repl/attach.py
@@ -3412,19 +49,6 @@ index 5eece441c6..11db26b0db 100644
{})
Test that IPython images still work even in latex output mode::
-diff --git a/src/sage/repl/display/pretty_print.py b/src/sage/repl/display/pretty_print.py
-index f3863dea6a..1b270b4e8f 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/repl/interpreter.py b/src/sage/repl/interpreter.py
index e843486e26..780cae264d 100644
--- a/src/sage/repl/interpreter.py
@@ -3588,309 +212,6 @@ index d342ba7fac..ab9504337e 100644
Next, test the ``pinfo2`` magic for ``R`` interface code, see :trac:`26906`::
-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 e02192345f..0a93cfb0ed 100644
---- a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
-+++ b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
-@@ -3781,7 +3781,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/function_field/divisor.py b/src/sage/rings/function_field/divisor.py
-index b81d5f5729..515253d351 100644
---- a/src/sage/rings/function_field/divisor.py
-+++ b/src/sage/rings/function_field/divisor.py
-@@ -394,7 +394,7 @@ 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()
-+ sage: D.dict() # random
- {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,
-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 e5e92420a2..83fa565962 100644
---- a/src/sage/rings/multi_power_series_ring_element.py
-+++ b/src/sage/rings/multi_power_series_ring_element.py
-@@ -1109,8 +1109,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 = {}
-@@ -1202,9 +1202,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 7612ed0ddc..38f4d81746 100644
---- a/src/sage/rings/number_field/S_unit_solver.py
-+++ b/src/sage/rings/number_field/S_unit_solver.py
-@@ -1597,7 +1597,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()):
-@@ -1761,31 +1761,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 ae3f927842..1f38ab731a 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 2adafe3309..80ec1d8821 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 c8538ee54a..fa707f47a6 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 34762d8de4..9b3fd022f0 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 22f29ee596..5f445d2a3b 100644
---- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
-+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-@@ -3577,11 +3577,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 0311cd71bb..4f26f35011 100644
---- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -3015,7 +3015,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 d2dec781fb..449f13dce2 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 277eaf1844..67ebd2515f 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 81aee6e5de..1957f948ad 100644
---- a/src/sage/rings/polynomial/polynomial_element_generic.py
-+++ b/src/sage/rings/polynomial/polynomial_element_generic.py
-@@ -340,7 +340,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 5e170e635b..5d5cb2f7ad 100644
---- a/src/sage/rings/polynomial/polynomial_ring.py
-+++ b/src/sage/rings/polynomial/polynomial_ring.py
-@@ -1203,7 +1203,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/qqbar.py b/src/sage/rings/qqbar.py
index 9c6ec027d0..4d3521c3e8 100644
--- a/src/sage/rings/qqbar.py
@@ -3911,1087 +232,3 @@ index 9c6ec027d0..4d3521c3e8 100644
"""
import sys
-diff --git a/src/sage/rings/ring_extension.pyx b/src/sage/rings/ring_extension.pyx
-index 754b8c2ca6..291ae46fe6 100644
---- a/src/sage/rings/ring_extension.pyx
-+++ b/src/sage/rings/ring_extension.pyx
-@@ -379,8 +379,8 @@ class RingExtensionFactory(UniqueFactory):
- 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}})]})
-+ {'print_options': {'print_elements_as': None, 'print_parent_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 +388,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 64ba29c77f..353ba7a950 100644
---- a/src/sage/rings/tate_algebra_element.pyx
-+++ b/src/sage/rings/tate_algebra_element.pyx
-@@ -2221,7 +2221,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 cebed8fb19..6e4711a65f 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)
-@@ -549,7 +549,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. ::
-
-@@ -1977,13 +1977,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
-@@ -2078,7 +2078,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
-@@ -2426,7 +2426,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()
-@@ -3004,9 +3005,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::
-
-@@ -4324,12 +4325,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,
-@@ -4926,7 +4927,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]
-
-@@ -6358,13 +6359,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 ca8407020f..88f72f17aa 100644
---- a/src/sage/schemes/projective/projective_space.py
-+++ b/src/sage/schemes/projective/projective_space.py
-@@ -1825,13 +1825,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 a1cb20567b..261fad83a3 100644
---- a/src/sage/schemes/riemann_surfaces/riemann_surface.py
-+++ b/src/sage/schemes/riemann_surfaces/riemann_surface.py
-@@ -1012,17 +1012,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 9818f2ada9..e87f5d1f74 100644
---- a/src/sage/schemes/toric/morphism.py
-+++ b/src/sage/schemes/toric/morphism.py
-@@ -647,7 +647,7 @@ 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(1, 0): (0), N(-1, -2): (-2), N(0, 1): (1)}
- sage: f._reverse_ray_map()
- {N(-2): 2, N(1): 1}
- """
-@@ -1955,7 +1955,7 @@ class SchemeMorphism_fan_fiber_component_toric_variety(SchemeMorphism):
- N(-1, 2) (11, 1)
- N(1, -3) (9, 2)
- 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(1, 0): 4, N(0, 1): 5, N(-3, 4): 10, N(2, -6): 9, 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 9e913cc1e7..dc01794cd2 100644
---- a/src/sage/schemes/toric/weierstrass.py
-+++ b/src/sage/schemes/toric/weierstrass.py
-@@ -260,16 +260,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 fe7b8fdec9..5974dd76a0 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 dcfc14b413..4e06ab69d6 100644
---- a/src/sage/structure/global_options.py
-+++ b/src/sage/structure/global_options.py
-@@ -1311,9 +1311,9 @@ class GlobalOptions(object):
-
- 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 804f962d97..ee84b2b91c 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 4fc44c8b86..482a288b90 100644
---- a/src/sage/structure/unique_representation.py
-+++ b/src/sage/structure/unique_representation.py
-@@ -859,7 +859,7 @@ class CachedRepresentation(six.with_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::
-diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron/base.py
-index 8f740b7621..1a2ff5a135 100644
---- a/src/sage/geometry/polyhedron/base.py
-+++ b/src/sage/geometry/polyhedron/base.py
-@@ -6072,20 +6072,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}
-
-@@ -6115,18 +6115,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}
-@@ -6166,22 +6166,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 0a05a75ef4..0fc48b551a 100644
---- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx
-+++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx
-@@ -1347,20 +1347,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}
-
-@@ -1389,7 +1389,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::
-
-@@ -1426,7 +1426,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/rings/ring_extension.pyx b/src/sage/rings/ring_extension.pyx
-index 291ae46fe6..b62834d226 100644
---- a/src/sage/rings/ring_extension.pyx
-+++ b/src/sage/rings/ring_extension.pyx
-@@ -379,7 +379,7 @@ class RingExtensionFactory(UniqueFactory):
- To: Rational Field
- Defn: 1 |--> 1, (), ()),
- {'constructors': [(<type 'sage.rings.ring_extension.RingExtension_generic'>,
-- {'print_options': {'print_elements_as': None, 'print_parent_as': None},
-+ {'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',))
-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/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/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/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/base.pyx b/src/sage/plot/plot3d/base.pyx
-index 81e7018681..3abb757af0 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/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/sagemath-jedi-0.16.patch b/sagemath-jedi-0.16.patch
index 27769bdb8cfd..477091a1c007 100644
--- a/sagemath-jedi-0.16.patch
+++ b/sagemath-jedi-0.16.patch
@@ -1,6 +1,6 @@
--- a/src/sage/all.py
+++ b/src/sage/all.py
-@@ -324,6 +324,9 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
+@@ -99,6 +99,9 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
# However, be sure to keep OUR deprecation warnings
warnings.filterwarnings('default', category=DeprecationWarning,
message=r'[\s\S]*See https\?://trac\.sagemath\.org/[0-9]* for details.')
@@ -10,4 +10,21 @@
# Python 3.8 deprecation warnings
warnings.filterwarnings('ignore', category=DeprecationWarning,
message='.*PY_SSIZE_T_CLEAN.*')
-
+diff --git a/src/sage/__init__.py b/src/sage/__init__.py
+index c5ebb92..e2ae5b8 100644
+--- a/src/sage/__init__.py
++++ b/src/sage/__init__.py
+@@ -56,13 +56,3 @@ def isfunction(obj):
+
+ import inspect
+ inspect.isfunction = isfunction
+-
+-
+-# Monkey-patch ExtensionFileLoader to allow IPython to find the sources
+-# of Cython files. See https://trac.sagemath.org/ticket/24681
+-try:
+- from importlib.machinery import ExtensionFileLoader
+-except ImportError:
+- pass # Python 2
+-else:
+- del ExtensionFileLoader.get_source
diff --git a/sagemath-no-dict-sorting.patch b/sagemath-no-dict-sorting.patch
new file mode 100644
index 000000000000..d0b06bee6dcc
--- /dev/null
+++ b/sagemath-no-dict-sorting.patch
@@ -0,0 +1,5150 @@
+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 4054bd5d9a..236b861c8a 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::
+@@ -559,7 +559,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 cc2b504296..119d5e37d3 100644
+--- a/src/sage/categories/crystals.py
++++ b/src/sage/categories/crystals.py
+@@ -75,7 +75,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 7b14ee25c1..f4a34aace0 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 391422bdf5..ef824b9777 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 a125fc602b..8f9838b7df 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::
+
+@@ -988,9 +988,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 27e436c636..38a2b5c383 100644
+--- a/src/sage/categories/pushout.py
++++ b/src/sage/categories/pushout.py
+@@ -2387,7 +2387,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 dc27b10920..2fefa65d8c 100644
+--- a/src/sage/coding/linear_code.py
++++ b/src/sage/coding/linear_code.py
+@@ -2677,22 +2677,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:
+
+@@ -2706,11 +2706,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 fcb53e3ac3..b1d988632d 100644
+--- a/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py
++++ b/src/sage/combinat/cluster_algebra_quiver/cluster_seed.py
+@@ -2735,119 +2735,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 afcc1fc669..95161c35a6 100644
+--- a/src/sage/combinat/crystals/kirillov_reshetikhin.py
++++ b/src/sage/combinat/crystals/kirillov_reshetikhin.py
+@@ -1188,11 +1188,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}
+@@ -1944,8 +1944,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]]}
+ """
+@@ -1964,8 +1964,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 33ecc32819..643e76c98c 100644
+--- a/src/sage/combinat/dyck_word.py
++++ b/src/sage/combinat/dyck_word.py
+@@ -431,12 +431,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 2e5c8d9884..59acb0e80a 100644
+--- a/src/sage/combinat/finite_state_machine.py
++++ b/src/sage/combinat/finite_state_machine.py
+@@ -2133,8 +2133,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
+ """
+@@ -7221,7 +7220,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)
+
+@@ -15054,7 +15053,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
+@@ -15081,7 +15080,7 @@ class _FSMProcessIteratorEpsilon_(FSMProcessIterator):
+ +-- tape at 0, [['c']]
+ process (0 branches)
+ sage: it.visited_states
+- {1: ['c'], 2: ['']}
++ {2: [''], 1: ['c']}
+
+ TESTS::
+
+@@ -15109,7 +15108,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
+@@ -15133,7 +15132,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)
+@@ -15149,7 +15148,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)
+@@ -15186,8 +15185,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:
+@@ -15205,8 +15203,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:
+@@ -15223,8 +15220,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:
+@@ -15371,9 +15367,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 141fe345d4..77c53ddd51 100644
+--- a/src/sage/combinat/growth.py
++++ b/src/sage/combinat/growth.py
+@@ -703,7 +703,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
+
+@@ -1358,7 +1358,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] / []
+
+@@ -1382,7 +1382,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] / []
+
+@@ -1390,7 +1390,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]
+
+@@ -1537,14 +1537,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 8770fb9c46..eb410837fe 100644
+--- a/src/sage/combinat/k_tableau.py
++++ b/src/sage/combinat/k_tableau.py
+@@ -2910,22 +2910,22 @@ class StrongTableau(ClonableList):
+
+ 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)]}
+
+@@ -4421,21 +4421,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 97dcce10ae..a3477f69f1 100644
+--- a/src/sage/combinat/matrices/latin.py
++++ b/src/sage/combinat/matrices/latin.py
+@@ -1101,68 +1101,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)})
+ """
+
+@@ -2771,12 +2771,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 792e884c62..f3321ca620 100755
+--- a/src/sage/combinat/multiset_partition_into_sets_ordered.py
++++ b/src/sage/combinat/multiset_partition_into_sets_ordered.py
+@@ -1498,15 +1498,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 24a0d00081..4e64ec58a1 100644
+--- a/src/sage/combinat/parallelogram_polyomino.py
++++ b/src/sage/combinat/parallelogram_polyomino.py
+@@ -559,16 +559,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}
+ """
+
+
+@@ -2566,16 +2566,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 e046474e85..9ee79fb359 100644
+--- a/src/sage/combinat/partition.py
++++ b/src/sage/combinat/partition.py
+@@ -3766,11 +3766,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 a78798746a..f478e5d043 100644
+--- a/src/sage/combinat/partition_tuple.py
++++ b/src/sage/combinat/partition_tuple.py
+@@ -1684,7 +1684,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 deac1eff88..b40a38ee25 100644
+--- a/src/sage/combinat/posets/posets.py
++++ b/src/sage/combinat/posets/posets.py
+@@ -4044,7 +4044,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(),
+@@ -7592,60 +7592,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 ef78e8b4e2..fde60b25b1 100644
+--- a/src/sage/combinat/set_partition.py
++++ b/src/sage/combinat/set_partition.py
+@@ -626,13 +626,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',
+@@ -660,13 +660,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 c52ea6e394..7a7f0da433 100644
+--- a/src/sage/combinat/similarity_class_type.py
++++ b/src/sage/combinat/similarity_class_type.py
+@@ -1593,7 +1593,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 d3c2495e44..5394c31a6c 100644
+--- a/src/sage/combinat/symmetric_group_representations.py
++++ b/src/sage/combinat/symmetric_group_representations.py
+@@ -540,8 +540,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
+@@ -565,8 +565,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 a3bdb3d433..6c2f088db5 100644
+--- a/src/sage/combinat/words/finite_word.py
++++ b/src/sage/combinat/words/finite_word.py
+@@ -4832,9 +4832,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()
+ {}
+
+@@ -7109,9 +7109,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 325c33220f..e85700c1d7 100644
+--- a/src/sage/combinat/words/suffix_trees.py
++++ b/src/sage/combinat/words/suffix_trees.py
+@@ -1654,7 +1654,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 0124f776d0..5683ae819e 100644
+--- a/src/sage/crypto/mq/sr.py
++++ b/src/sage/crypto/mq/sr.py
+@@ -1654,49 +1654,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 c91a49c06b..e50b4e586a 100644
+--- a/src/sage/doctest/forker.py
++++ b/src/sage/doctest/forker.py
+@@ -139,7 +139,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
+@@ -183,15 +183,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"
+- # 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
+-
+ # 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 f980982715..0b77d5d84d 100644
+--- a/src/sage/doctest/util.py
++++ b/src/sage/doctest/util.py
+@@ -78,7 +78,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 iteritems(self):
+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 ef3ad4d644..b83588c249 100644
+--- a/src/sage/geometry/polyhedron/base.py
++++ b/src/sage/geometry/polyhedron/base.py
+@@ -6063,20 +6063,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}
+
+@@ -6106,18 +6106,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}
+@@ -6157,22 +6157,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 969c9f86db..25843ea25a 100644
+--- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx
++++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx
+@@ -1465,20 +1465,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}
+
+@@ -1507,7 +1507,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::
+
+@@ -1544,7 +1544,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 4281de7bf0..8bc045a34b 100644
+--- a/src/sage/geometry/polyhedron/ppl_lattice_polytope.py
++++ b/src/sage/geometry/polyhedron/ppl_lattice_polytope.py
+@@ -1231,15 +1231,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 6f8222d07c..1c94998e15 100644
+--- a/src/sage/geometry/triangulation/element.py
++++ b/src/sage/geometry/triangulation/element.py
+@@ -605,32 +605,32 @@ class Triangulation(Element):
+
+ sage: triangulation = polytopes.hypercube(2).triangulate(engine='internal')
+ sage: triangulation._boundary_simplex_dictionary()
+- {(0, 1): ((0, 1, 3),),
+- (0, 2): ((0, 2, 3),),
++ {(1, 3): ((0, 1, 3),),
+ (0, 3): ((0, 1, 3), (0, 2, 3)),
+- (1, 3): ((0, 1, 3),),
+- (2, 3): ((0, 2, 3),)}
++ (0, 1): ((0, 1, 3),),
++ (2, 3): ((0, 2, 3),),
++ (0, 2): ((0, 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:
+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 00d852010d..fabe0ffa71 100644
+--- a/src/sage/graphs/digraph.py
++++ b/src/sage/graphs/digraph.py
+@@ -2675,7 +2675,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')
+@@ -2720,15 +2720,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 c369e3723a..50edd704b2 100644
+--- a/src/sage/graphs/generic_graph.py
++++ b/src/sage/graphs/generic_graph.py
+@@ -5211,7 +5211,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) '
+@@ -5265,16 +5265,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]
+@@ -5283,7 +5283,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):
+@@ -5294,9 +5294,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]}
+
+ TESTS::
+
+@@ -16514,7 +16514,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::
+
+@@ -16524,7 +16543,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)
+@@ -16534,7 +16562,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]}
+
+@@ -16783,7 +16811,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::
+
+@@ -18909,18 +18956,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:
+
+@@ -19065,8 +19112,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
+@@ -19202,10 +19249,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)})
+@@ -19389,13 +19436,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")
+@@ -19407,15 +19454,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
+
+@@ -23574,7 +23621,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,
+@@ -23583,7 +23631,6 @@ class GenericGraph(GenericGraph_pyx):
+ 7: 0.000000000000000,
+ 8: 18.6846846846847,
+ 9: 0.000000000000000,
+- 10: 20.9819819819820,
+ 11: 202.778914049184}
+
+
+@@ -23603,7 +23650,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 e76003f23c..d1ec1a9e05 100644
+--- a/src/sage/graphs/graph.py
++++ b/src/sage/graphs/graph.py
+@@ -3820,7 +3820,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):
+ ...
+@@ -4103,10 +4103,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 f2200f5712..c828bb41df 100644
+--- a/src/sage/graphs/graph_coloring.pyx
++++ b/src/sage/graphs/graph_coloring.pyx
+@@ -1028,10 +1028,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 6db80b2bd3..8f54c9b64f 100644
+--- a/src/sage/graphs/isgci.py
++++ b/src/sage/graphs/isgci.py
+@@ -759,7 +759,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()
+@@ -776,13 +776,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 241288a4de..0a6d2257aa 100644
+--- a/src/sage/graphs/schnyder.py
++++ b/src/sage/graphs/schnyder.py
+@@ -473,7 +473,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 27860001cd..38f9cd8a79 100644
+--- a/src/sage/graphs/tutte_polynomial.py
++++ b/src/sage/graphs/tutte_polynomial.py
+@@ -386,7 +386,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 78602206c2..74cdb272d9 100644
+--- a/src/sage/groups/perm_gps/cubegroup.py
++++ b/src/sage/groups/perm_gps/cubegroup.py
+@@ -691,12 +691,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 eda927fb17..3aff0d2b43 100644
+--- a/src/sage/knots/link.py
++++ b/src/sage/knots/link.py
+@@ -752,47 +752,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 8a42138784..6644d91855 100644
+--- a/src/sage/matroids/catalog.py
++++ b/src/sage/matroids/catalog.py
+@@ -725,7 +725,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/misc/package.py b/src/sage/misc/package.py
+index 2b1106cdc4..7c5e519bfa 100644
+--- a/src/sage/misc/package.py
++++ b/src/sage/misc/package.py
+@@ -198,18 +198,21 @@ def list_packages(*pkg_types, **opts):
+ 'zn_poly',
+ 'zope_interface']
+ sage: L['ppl'] # optional - build
+- {'installed': True,
++ {'name': 'ppl',
++ 'type': 'standard',
++ 'source': 'normal',
+ 'installed_version': '...',
+- 'remote_version': '...',
+- 'type': 'standard'}
++ 'installed': True,
++ 'remote_version': '...'}
+
+ sage: L = list_packages(pkg_sources=['pip'], local=True) # optional - build
+ sage: L['beautifulsoup4'] # optional - build
+- {'installed': ...,
+- 'installed_version': ...,
+- 'remote_version': None,
++ {'name': 'beautifulsoup4',
++ 'type': 'optional',
+ 'source': 'pip',
+- 'type': 'optional'}
++ 'installed_version': ...,
++ 'installed': False,
++ 'remote_version': None}
+
+ sage: L = list_packages(pkg_sources=['pip']) # optional - build internet
+ sage: L['beautifulsoup4'] # optional - build internet
+diff --git a/src/sage/modular/arithgroup/arithgroup_perm.py b/src/sage/modular/arithgroup/arithgroup_perm.py
+index 6559327295..7a2bec3b04 100644
+--- a/src/sage/modular/arithgroup/arithgroup_perm.py
++++ b/src/sage/modular/arithgroup/arithgroup_perm.py
+@@ -2388,7 +2388,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 aa91f91db9..702ec9e56f 100644
+--- a/src/sage/modular/arithgroup/congroup_gammaH.py
++++ b/src/sage/modular/arithgroup/congroup_gammaH.py
+@@ -595,6 +595,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],
+@@ -612,8 +613,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 dd5332c879..6e3e0589ac 100644
+--- a/src/sage/modular/dirichlet.py
++++ b/src/sage/modular/dirichlet.py
+@@ -2277,7 +2277,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 931661d26c..cfd152e992 100644
+--- a/src/sage/plot/graphics.py
++++ b/src/sage/plot/graphics.py
+@@ -1297,8 +1297,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]}
+
+@@ -2244,13 +2244,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:
+@@ -2303,18 +2303,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 81e7018681..3abb757af0 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 f3863dea6a..1b270b4e8f 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 8b03d221b6..651438358f 100644
+--- a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
++++ b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
+@@ -3791,7 +3791,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 e5e92420a2..83fa565962 100644
+--- a/src/sage/rings/multi_power_series_ring_element.py
++++ b/src/sage/rings/multi_power_series_ring_element.py
+@@ -1109,8 +1109,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 = {}
+@@ -1202,9 +1202,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 7612ed0ddc..38f4d81746 100644
+--- a/src/sage/rings/number_field/S_unit_solver.py
++++ b/src/sage/rings/number_field/S_unit_solver.py
+@@ -1597,7 +1597,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()):
+@@ -1761,31 +1761,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 bed2266fad..597be70bda 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 34762d8de4..9b3fd022f0 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 962205f4de..9db232d6c7 100644
+--- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
++++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
+@@ -3577,11 +3577,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 277eaf1844..67ebd2515f 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 81aee6e5de..1957f948ad 100644
+--- a/src/sage/rings/polynomial/polynomial_element_generic.py
++++ b/src/sage/rings/polynomial/polynomial_element_generic.py
+@@ -340,7 +340,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 ce311014d3..799cd00aa7 100644
+--- a/src/sage/rings/polynomial/polynomial_ring.py
++++ b/src/sage/rings/polynomial/polynomial_ring.py
+@@ -1203,7 +1203,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..291ae46fe6 100644
+--- a/src/sage/rings/ring_extension.pyx
++++ b/src/sage/rings/ring_extension.pyx
+@@ -379,8 +379,8 @@ class RingExtensionFactory(UniqueFactory):
+ 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}})]})
++ {'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 +388,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 64ba29c77f..353ba7a950 100644
+--- a/src/sage/rings/tate_algebra_element.pyx
++++ b/src/sage/rings/tate_algebra_element.pyx
+@@ -2221,7 +2221,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 6eb0df739d..cd0716728c 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)
+@@ -549,7 +549,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. ::
+
+@@ -1977,13 +1977,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
+@@ -2078,7 +2078,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
+@@ -2426,7 +2426,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()
+@@ -3004,9 +3005,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::
+
+@@ -4324,12 +4325,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,
+@@ -4926,7 +4927,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]
+
+@@ -6358,13 +6359,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 64a40170de..4d90bdc703 100644
+--- a/src/sage/schemes/projective/projective_space.py
++++ b/src/sage/schemes/projective/projective_space.py
+@@ -1825,13 +1825,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 3eac1ea46f..4c84df6514 100644
+--- a/src/sage/schemes/riemann_surfaces/riemann_surface.py
++++ b/src/sage/schemes/riemann_surfaces/riemann_surface.py
+@@ -1012,17 +1012,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 9818f2ada9..4c14eb94c3 100644
+--- a/src/sage/schemes/toric/morphism.py
++++ b/src/sage/schemes/toric/morphism.py
+@@ -587,7 +587,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
+ """
+@@ -647,9 +647,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()
+@@ -1815,7 +1815,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::
+
+@@ -1955,7 +1955,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 788dc3d1ae..c0c6aadc2f 100644
+--- a/src/sage/schemes/toric/weierstrass.py
++++ b/src/sage/schemes/toric/weierstrass.py
+@@ -260,16 +260,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 3c9c27d1f2..7a9a3ca4d5 100644
+--- a/src/sage/structure/global_options.py
++++ b/src/sage/structure/global_options.py
+@@ -1311,9 +1311,9 @@ class GlobalOptions(object):
+
+ 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 d24858673f..6ac7af6830 100644
+--- a/src/sage/structure/unique_representation.py
++++ b/src/sage/structure/unique_representation.py
+@@ -859,7 +859,7 @@ class CachedRepresentation(six.with_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::
diff --git a/sagemath-pari-2.11.3.patch b/sagemath-pari-2.11.3.patch
index 67870ccf5507..7cb469d255a9 100644
--- a/sagemath-pari-2.11.3.patch
+++ b/sagemath-pari-2.11.3.patch
@@ -1,5 +1,5 @@
diff --git a/src/sage/lfunctions/dokchitser.py b/src/sage/lfunctions/dokchitser.py
-index 680ac17dfd..1bf8953a77 100644
+index 680ac17..1bf8953 100644
--- a/src/sage/lfunctions/dokchitser.py
+++ b/src/sage/lfunctions/dokchitser.py
@@ -111,7 +111,7 @@ class Dokchitser(SageObject):
@@ -21,7 +21,7 @@ index 680ac17dfd..1bf8953a77 100644
If we choose the sign in functional equation for the
`\zeta` function incorrectly, the functional equation
diff --git a/src/sage/lfunctions/pari.py b/src/sage/lfunctions/pari.py
-index c60f944ed4..1daa219c00 100644
+index c60f944..1daa219 100644
--- a/src/sage/lfunctions/pari.py
+++ b/src/sage/lfunctions/pari.py
@@ -423,7 +423,7 @@ class LFunction(SageObject):
@@ -33,97 +33,11 @@ index c60f944ed4..1daa219c00 100644
.. RUBRIC:: Rank 2 elliptic curve
-diff --git a/src/sage/schemes/elliptic_curves/ell_number_field.py b/src/sage/schemes/elliptic_curves/ell_number_field.py
-index 2967f085ca..b423c2b7ed 100644
---- a/src/sage/schemes/elliptic_curves/ell_number_field.py
-+++ b/src/sage/schemes/elliptic_curves/ell_number_field.py
-@@ -302,7 +302,8 @@ class EllipticCurve_number_field(EllipticCurve_field):
- (3,
- 3,
- [(0 : 0 : 1),
-- (-1/2*zeta43_0^2 - 1/2*zeta43_0 + 7 : -3/2*zeta43_0^2 - 5/2*zeta43_0 + 18 : 1)])
-+ (-1/2*zeta43_0^2 - 1/2*zeta43_0 + 7 : -3/2*zeta43_0^2 - 5/2*zeta43_0 + 18 : 1),
-+ (5/8*zeta43_0^2 + 17/8*zeta43_0 - 9/4 : -27/16*zeta43_0^2 - 103/16*zeta43_0 + 39/8 : 1)])
- """
- verbose = int(verbose)
- if known_points is None:
-@@ -810,7 +810,7 @@ class EllipticCurve_number_field(EllipticCurve_field):
- sage: K.<v> = NumberField(x^2 + 161*x - 150)
- sage: E = EllipticCurve([25105/216*v - 3839/36, 634768555/7776*v - 98002625/1296, 634768555/7776*v - 98002625/1296, 0, 0])
- sage: E.global_integral_model()
-- Elliptic Curve defined by y^2 + (2094779518028859*v-1940492905300351)*x*y + (477997268472544193101178234454165304071127500*v-442791377441346852919930773849502871958097500)*y = x^3 + (26519784690047674853185542622500*v-24566525306469707225840460652500)*x^2 over Number Field in v with defining polynomial x^2 + 161*x - 150
-+ Elliptic Curve defined by y^2 + (33872485050625*v-31078224284250)*x*y + (2020602604156076340058146664245468750000*v-1871778534673615560803175189398437500000)*y = x^3 + (6933305282258321342920781250*v-6422644400723486559914062500)*x^2 over Number Field in v with defining polynomial x^2 + 161*x - 150
-
- :trac:`14476`::
-
-@@ -923,10 +923,10 @@ class EllipticCurve_number_field(EllipticCurve_field):
- sage: E1 = E.scale_curve(u^5)
- sage: E1.ainvs()
- (0,
-- 0,
-- 0,
-- 28087920796764302856*a + 88821804456186580548,
-- -77225139016967233228487820912*a - 244207331916752959911655344864)
-+ 0,
-+ 0,
-+ 193309837823322216*a - 611299381639464252,
-+ -3379649566176127326923323632*a + 10687390322316522207588229536)
- sage: E1._scale_by_units().ainvs()
- (0, 0, 0, 4536*a + 14148, -163728*a - 474336)
-
-diff --git a/src/sage/rings/number_field/unit_group.py b/src/sage/rings/number_field/unit_group.py
-index 6ed0aea16b..529e23a559 100644
---- a/src/sage/rings/number_field/unit_group.py
-+++ b/src/sage/rings/number_field/unit_group.py
-@@ -279,7 +279,7 @@ class UnitGroup(AbelianGroupWithValues_class):
- sage: K.unit_group()
- Unit group with structure C2 x Z x Z of Number Field in a with defining polynomial 7/9*x^3 + 7/3*x^2 - 56*x + 123
- sage: UnitGroup(K, S=tuple(K.primes_above(7)))
-- S-unit group with structure C2 x Z x Z x Z of Number Field in a with defining polynomial 7/9*x^3 + 7/3*x^2 - 56*x + 123 with S = (Fractional ideal (7/225*a^2 - 7/75*a - 42/25),)
-+ S-unit group with structure C2 x Z x Z x Z of Number Field in a with defining polynomial 7/9*x^3 + 7/3*x^2 - 56*x + 123 with S = (Fractional ideal (28/225*a^2 + 77/75*a - 133/25),)
-
- Conversion from unit group to a number field and back
- gives the right results (:trac:`25874`)::
-diff --git a/src/sage/rings/number_field/number_field_element.pyx b/src/sage/rings/number_field/number_field_element.pyx
-index 59bab07db0..079eaaa6a2 100644
---- a/src/sage/rings/number_field/number_field_element.pyx
-+++ b/src/sage/rings/number_field/number_field_element.pyx
-@@ -1733,7 +1733,7 @@ cdef class NumberFieldElement(FieldElement):
- sage: P.<X> = K[]
- sage: L = NumberField(X^2 + a^2 + 2*a + 1, 'b')
- sage: K(17)._rnfisnorm(L)
-- ((a^2 - 2)*b - 4, 1)
-+ ((a^2 - 2)*b + 4, 1)
-
- sage: K.<a> = NumberField(x^3 + x + 1)
- sage: Q.<X> = K[]
-diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index 16bd277370..2eda5ba659 100644
---- a/src/sage/rings/number_field/number_field_ideal.py
-+++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -1827,7 +1827,7 @@ class NumberFieldFractionalIdeal(MultiplicativeGroupElement, NumberFieldIdeal):
-
- sage: F.<a> = NumberField(2*x^3 + x + 1)
- sage: fact = F.factor(2); fact
-- (Fractional ideal (2*a^2 + 1))^2 * (Fractional ideal (-2*a^2))
-+ (Fractional ideal (-2*a^2 - 1))^2 * (Fractional ideal (2*a^2))
- sage: [p[0].norm() for p in fact]
- [2, 2]
- """
-@@ -2418,7 +2418,7 @@ class NumberFieldFractionalIdeal(MultiplicativeGroupElement, NumberFieldIdeal):
- sage: A.is_coprime(B)
- False
- sage: lam = A.idealcoprime(B); lam
-- -1/6*a + 1/6
-+ 1/6*a - 1/6
- sage: (lam*A).is_coprime(B)
- True
-
diff --git a/src/sage/rings/number_field/number_field.py b/src/sage/rings/number_field/number_field.py
-index e39c347747..aba9eb960f 100644
+index 2732f22..6c2a453 100644
--- a/src/sage/rings/number_field/number_field.py
+++ b/src/sage/rings/number_field/number_field.py
-@@ -3266,18 +3266,18 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
+@@ -3433,18 +3433,18 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
Fractional ideal (2, 1/2*a - 1/2)
Fractional ideal (2, 1/2*a + 1/2)
3
@@ -145,7 +59,7 @@ index e39c347747..aba9eb960f 100644
7
8
Fractional ideal (1/2*a + 3/2)
-@@ -3285,9 +3285,9 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
+@@ -3452,9 +3452,9 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
Fractional ideal (4, a + 1)
Fractional ideal (1/2*a - 3/2)
9
@@ -157,7 +71,7 @@ index e39c347747..aba9eb960f 100644
10
"""
hnf_ideals = self.pari_nf().ideallist(bound)
-@@ -4383,7 +4383,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
+@@ -4550,7 +4550,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
-1/13*a^2 + 6/13*a + 345/13,
-1,
2/13*a^2 + 1/13*a - 755/13,
@@ -166,7 +80,7 @@ index e39c347747..aba9eb960f 100644
[(Fractional ideal (11, a - 2), 2), (Fractional ideal (19, a + 7), 2)])
Number fields defined by non-monic and non-integral
-@@ -4541,9 +4541,9 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
+@@ -4708,9 +4708,9 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
-1/13*a^2 + 6/13*a + 345/13,
-1,
2/13*a^2 + 1/13*a - 755/13,
@@ -179,7 +93,7 @@ index e39c347747..aba9eb960f 100644
Verify that :trac:`16708` is fixed::
-@@ -5188,7 +5188,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
+@@ -5355,7 +5355,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
sage: K.<a> = NumberField(7/9*x^3 + 7/3*x^2 - 56*x + 123)
sage: K.elements_of_norm(7)
@@ -188,7 +102,7 @@ index e39c347747..aba9eb960f 100644
"""
proof = proof_flag(proof)
B = self.pari_bnf(proof).bnfisintnorm(n)
-@@ -5291,7 +5291,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
+@@ -5458,7 +5458,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
sage: pari('setrand(2)')
sage: L.<b> = K.extension(x^2 - 7)
sage: f = L.factor(a + 1); f
@@ -197,7 +111,7 @@ index e39c347747..aba9eb960f 100644
sage: f.value() == a+1
True
-@@ -6368,7 +6368,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
+@@ -6535,7 +6535,7 @@ class NumberField_generic(WithEqualityById, number_field_base.NumberField):
sage: [K.uniformizer(P) for P,e in factor(K.ideal(5))]
[t^2 - t + 1, t + 2, t - 2]
sage: [K.uniformizer(P) for P,e in factor(K.ideal(7))]
@@ -206,7 +120,7 @@ index e39c347747..aba9eb960f 100644
sage: [K.uniformizer(P) for P,e in factor(K.ideal(67))]
[t + 23, t + 26, t - 32, t - 18]
-@@ -7638,11 +7638,11 @@ class NumberField_absolute(NumberField_generic):
+@@ -7805,11 +7805,11 @@ class NumberField_absolute(NumberField_generic):
Ring morphism:
From: Number Field in a1 with defining polynomial x^3 - 7*x - 7
To: Number Field in a with defining polynomial 7/9*x^3 + 7/3*x^2 - 56*x + 123
@@ -220,11 +134,59 @@ index e39c347747..aba9eb960f 100644
"""
if name is None:
name = self.variable_names()
+diff --git a/src/sage/rings/number_field/number_field_element.pyx b/src/sage/rings/number_field/number_field_element.pyx
+index 59bab07..079eaaa 100644
+--- a/src/sage/rings/number_field/number_field_element.pyx
++++ b/src/sage/rings/number_field/number_field_element.pyx
+@@ -1733,7 +1733,7 @@ cdef class NumberFieldElement(FieldElement):
+ sage: P.<X> = K[]
+ sage: L = NumberField(X^2 + a^2 + 2*a + 1, 'b')
+ sage: K(17)._rnfisnorm(L)
+- ((a^2 - 2)*b - 4, 1)
++ ((a^2 - 2)*b + 4, 1)
+
+ sage: K.<a> = NumberField(x^3 + x + 1)
+ sage: Q.<X> = K[]
+diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
+index b4eabe8..d746dcb 100644
+--- a/src/sage/rings/number_field/number_field_ideal.py
++++ b/src/sage/rings/number_field/number_field_ideal.py
+@@ -1827,7 +1827,7 @@ class NumberFieldFractionalIdeal(MultiplicativeGroupElement, NumberFieldIdeal):
+
+ sage: F.<a> = NumberField(2*x^3 + x + 1)
+ sage: fact = F.factor(2); fact
+- (Fractional ideal (2*a^2 + 1))^2 * (Fractional ideal (-2*a^2))
++ (Fractional ideal (-2*a^2 - 1))^2 * (Fractional ideal (2*a^2))
+ sage: [p[0].norm() for p in fact]
+ [2, 2]
+ """
+@@ -2418,7 +2418,7 @@ class NumberFieldFractionalIdeal(MultiplicativeGroupElement, NumberFieldIdeal):
+ sage: A.is_coprime(B)
+ False
+ sage: lam = A.idealcoprime(B); lam
+- -1/6*a + 1/6
++ 1/6*a - 1/6
+ sage: (lam*A).is_coprime(B)
+ True
+
+diff --git a/src/sage/rings/number_field/unit_group.py b/src/sage/rings/number_field/unit_group.py
+index 6ed0aea..529e23a 100644
+--- a/src/sage/rings/number_field/unit_group.py
++++ b/src/sage/rings/number_field/unit_group.py
+@@ -279,7 +279,7 @@ class UnitGroup(AbelianGroupWithValues_class):
+ sage: K.unit_group()
+ Unit group with structure C2 x Z x Z of Number Field in a with defining polynomial 7/9*x^3 + 7/3*x^2 - 56*x + 123
+ sage: UnitGroup(K, S=tuple(K.primes_above(7)))
+- S-unit group with structure C2 x Z x Z x Z of Number Field in a with defining polynomial 7/9*x^3 + 7/3*x^2 - 56*x + 123 with S = (Fractional ideal (7/225*a^2 - 7/75*a - 42/25),)
++ S-unit group with structure C2 x Z x Z x Z of Number Field in a with defining polynomial 7/9*x^3 + 7/3*x^2 - 56*x + 123 with S = (Fractional ideal (28/225*a^2 + 77/75*a - 133/25),)
+
+ Conversion from unit group to a number field and back
+ gives the right results (:trac:`25874`)::
diff --git a/src/sage/rings/polynomial/polynomial_quotient_ring.py b/src/sage/rings/polynomial/polynomial_quotient_ring.py
-index 397e92d0fd..1974eaae8b 100644
+index 1e2052c..2c05db9 100644
--- a/src/sage/rings/polynomial/polynomial_quotient_ring.py
+++ b/src/sage/rings/polynomial/polynomial_quotient_ring.py
-@@ -1296,9 +1296,9 @@ class PolynomialQuotientRing_generic(CommutativeRing):
+@@ -1293,9 +1293,9 @@ class PolynomialQuotientRing_generic(CommutativeRing):
1/16*a*xbar^3 + (-1/16*a - 1/8)*xbar^2 + 23/16*a*xbar - 23/16*a - 23/8),
6),
((-5/4*xbar^2 - 115/4,
@@ -237,7 +199,7 @@ index 397e92d0fd..1974eaae8b 100644
2)]
By using the ideal `(a)`, we cut the part of the class group coming from
-@@ -1428,9 +1428,9 @@ class PolynomialQuotientRing_generic(CommutativeRing):
+@@ -1425,9 +1425,9 @@ class PolynomialQuotientRing_generic(CommutativeRing):
1/16*a*xbar^3 + (-1/16*a - 1/8)*xbar^2 + 23/16*a*xbar - 23/16*a - 23/8),
6),
((-5/4*xbar^2 - 115/4,
@@ -250,3 +212,41 @@ index 397e92d0fd..1974eaae8b 100644
2)]
Note that all the returned values live where we expect them to::
+diff --git a/src/sage/schemes/elliptic_curves/ell_number_field.py b/src/sage/schemes/elliptic_curves/ell_number_field.py
+index 2967f08..300278b 100644
+--- a/src/sage/schemes/elliptic_curves/ell_number_field.py
++++ b/src/sage/schemes/elliptic_curves/ell_number_field.py
+@@ -302,7 +302,8 @@ class EllipticCurve_number_field(EllipticCurve_field):
+ (3,
+ 3,
+ [(0 : 0 : 1),
+- (-1/2*zeta43_0^2 - 1/2*zeta43_0 + 7 : -3/2*zeta43_0^2 - 5/2*zeta43_0 + 18 : 1)])
++ (-1/2*zeta43_0^2 - 1/2*zeta43_0 + 7 : -3/2*zeta43_0^2 - 5/2*zeta43_0 + 18 : 1),
++ (5/8*zeta43_0^2 + 17/8*zeta43_0 - 9/4 : -27/16*zeta43_0^2 - 103/16*zeta43_0 + 39/8 : 1)])
+ """
+ verbose = int(verbose)
+ if known_points is None:
+@@ -810,7 +811,7 @@ class EllipticCurve_number_field(EllipticCurve_field):
+ sage: K.<v> = NumberField(x^2 + 161*x - 150)
+ sage: E = EllipticCurve([25105/216*v - 3839/36, 634768555/7776*v - 98002625/1296, 634768555/7776*v - 98002625/1296, 0, 0])
+ sage: E.global_integral_model()
+- Elliptic Curve defined by y^2 + (2094779518028859*v-1940492905300351)*x*y + (477997268472544193101178234454165304071127500*v-442791377441346852919930773849502871958097500)*y = x^3 + (26519784690047674853185542622500*v-24566525306469707225840460652500)*x^2 over Number Field in v with defining polynomial x^2 + 161*x - 150
++ Elliptic Curve defined by y^2 + (33872485050625*v-31078224284250)*x*y + (2020602604156076340058146664245468750000*v-1871778534673615560803175189398437500000)*y = x^3 + (6933305282258321342920781250*v-6422644400723486559914062500)*x^2 over Number Field in v with defining polynomial x^2 + 161*x - 150
+
+ :trac:`14476`::
+
+@@ -923,10 +924,10 @@ class EllipticCurve_number_field(EllipticCurve_field):
+ sage: E1 = E.scale_curve(u^5)
+ sage: E1.ainvs()
+ (0,
+- 0,
+- 0,
+- 28087920796764302856*a + 88821804456186580548,
+- -77225139016967233228487820912*a - 244207331916752959911655344864)
++ 0,
++ 0,
++ 193309837823322216*a - 611299381639464252,
++ -3379649566176127326923323632*a + 10687390322316522207588229536)
+ sage: E1._scale_by_units().ainvs()
+ (0, 0, 0, 4536*a + 14148, -163728*a - 474336)
+
diff --git a/sagemath-python-3.8.patch b/sagemath-python-3.8.patch
index eb8dd790cfda..93253065bade 100644
--- a/sagemath-python-3.8.patch
+++ b/sagemath-python-3.8.patch
@@ -144,6 +144,105 @@ diff --git a/src/sage/combinat/posets/posets.py b/src/sage/combinat/posets/poset
index f1463c3184..ee48a3abc2 100644
--- a/src/sage/combinat/posets/posets.py
+++ b/src/sage/combinat/posets/posets.py
+@@ -7592,60 +7592,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, 14)): 0,
+- ((-1, 0), (0, -13)): 0,
+- ((-1, 0), (0, 12)): 0,
+- ((-1, 0), (0, 16)): 0,
+- ((1, 12), (2, 0)): 0,
+- ((0, 14), (1, 12)): 0,
+- ((0, 14), (1, 14)): 1,
+- ((1, 16), (2, 0)): 0,
++ {((1, 12), (2, 0)): 0,
++ ((0, 16), (1, 12)): 0,
++ ((0, 16), (1, 16)): 1,
++ ((1, 14), (2, 0)): 0,
+ ((0, -13), (1, 12)): 0,
+- ((0, -13), (1, 16)): 0,
+ ((0, -13), (1, 14)): 0,
+ ((0, -13), (1, -13)): 1,
+- ((1, 14), (2, 0)): 0,
++ ((0, -13), (1, 16)): 0,
++ ((-1, 0), (0, 16)): 0,
++ ((-1, 0), (0, -13)): 0,
++ ((-1, 0), (0, 12)): 0,
++ ((-1, 0), (0, 14)): 0,
+ ((0, 12), (1, 12)): 1,
+- ((0, 16), (1, 12)): 0,
+- ((0, 16), (1, 16)): 1,
+- ((1, -13), (2, 0)): 0}
++ ((1, -13), (2, 0)): 0,
++ ((1, 16), (2, 0)): 0,
++ ((0, 14), (1, 12)): 0,
++ ((0, 14), (1, 14)): 1}
+ 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, 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, 8)): 0,
+- ((-1, 0), (0, 1)): 0,
++ {((0, 2), (1, 2)): 1,
++ ((0, 5), (1, 5)): 1,
++ ((1, 6), (2, 0)): 0,
++ ((0, 8), (1, 8)): 1,
++ ((1, 3), (2, 0)): 0,
++ ((1, 9), (2, 0)): 0,
++ ((0, 1), (1, 1)): 1,
+ ((0, 7), (1, 7)): 1,
+ ((0, 7), (1, 5)): 0,
+- ((1, 6), (2, 0)): 0,
+- ((0, 3), (1, 3)): 1,
+- ((0, 3), (1, 2)): 0,
+- ((0, 3), (1, 1)): 0,
+ ((1, 2), (2, 0)): 0,
+- ((1, 5), (2, 0)): 0,
++ ((0, 4), (1, 4)): 1,
+ ((0, 4), (1, 3)): 0,
+ ((0, 4), (1, 2)): 0,
+ ((0, 4), (1, 1)): 0,
+- ((0, 4), (1, 4)): 1,
++ ((1, 5), (2, 0)): 0,
++ ((1, 8), (2, 0)): 0,
++ ((-1, 0), (0, 2)): 0,
++ ((-1, 0), (0, 9)): 0,
++ ((-1, 0), (0, 5)): 0,
++ ((-1, 0), (0, 6)): 0,
++ ((-1, 0), (0, 8)): 0,
++ ((-1, 0), (0, 1)): 0,
++ ((-1, 0), (0, 7)): 0,
++ ((-1, 0), (0, 4)): 0,
++ ((-1, 0), (0, 3)): 0,
+ ((1, 1), (2, 0)): 0,
++ ((0, 3), (1, 3)): 1,
++ ((0, 3), (1, 2)): 0,
++ ((0, 3), (1, 1)): 0,
++ ((0, 9), (1, 9)): 1,
++ ((0, 9), (1, 1)): 0,
+ ((1, 4), (2, 0)): 0,
+- ((0, 5), (1, 5)): 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,
+- ((0, 2), (1, 2)): 1})
++ ((1, 7), (2, 0)): 0})
+
+ AUTHOR:
+
@@ -7844,9 +7844,9 @@ class FinitePoset(UniqueRepresentation, Parent):
sage: P = posets.AntichainPoset(3)
sage: Pc = P.cuts()
@@ -641,7 +740,7 @@ diff --git a/src/sage/geometry/polyhedron/library.py b/src/sage/geometry/polyhed
index d66997fc95..57a039d4d6 100644
--- a/src/sage/geometry/polyhedron/library.py
+++ b/src/sage/geometry/polyhedron/library.py
-@@ -2286,12 +2286,12 @@ class Polytopes():
+@@ -2287,12 +2287,12 @@ class Polytopes():
sage: perm_a2_reg = polytopes.generalized_permutahedron(['A',2],regular=True)
sage: perm_a2_reg.vertices()
@@ -658,7 +757,7 @@ index d66997fc95..57a039d4d6 100644
sage: perm_a2_reg.is_inscribed()
True
sage: perm_a3_reg = polytopes.generalized_permutahedron(['A',3],regular=True)
-@@ -2303,20 +2303,20 @@ class Polytopes():
+@@ -2304,20 +2304,20 @@ class Polytopes():
sage: perm_a2_inexact = polytopes.generalized_permutahedron(['A',2],exact=False)
sage: perm_a2_inexact.vertices()
(A vertex at (0.0, 1.0),
@@ -719,8 +818,8 @@ index 9f7e1f418e..0ec459e7d3 100644
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]}
-+ {0: [0, 5], 1: [1, 4], 2: [5, 1], 3: [3, 1], 4: [1, 0], 5: [2, 1], 6: [1, 3]}
+- {1: [5, 1], 2: [0, 5], 3: [1, 0], 0: [1, 4], 4: [1, 2], 5: [2, 1], 6: [4, 1]}
++ {2: [5, 1], 0: [0, 5], 4: [1, 0], 1: [1, 4], 3: [3, 1], 5: [2, 1], 6: [1, 3]}
"""
deprecation(24494, 'This method is replaced by the method layout. '
'Please use layout(layout="planar", save_pos=True) '
@@ -728,21 +827,21 @@ index 9f7e1f418e..0ec459e7d3 100644
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]}
-+ {0: [0, 8],
+- 8: [1, 1]}
++ {2: [8, 1],
++ 0: [0, 8],
++ 4: [1, 0],
+ 1: [6, 2],
-+ 2: [8, 1],
+ 3: [6, 1],
-+ 4: [1, 0],
+ 5: [5, 2],
+ 6: [2, 2],
+ 7: [2, 3],
@@ -758,8 +857,8 @@ index 9f7e1f418e..0ec459e7d3 100644
+ [93, 14]
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]}
-+ {0: [0, 5], 1: [1, 4], 2: [5, 1], 3: [3, 1], 4: [1, 0], 5: [2, 1], 6: [1, 3]}
+- {1: [5, 1], 2: [0, 5], 3: [1, 0], 0: [1, 4], 4: [1, 2], 5: [2, 1], 6: [4, 1]}
++ {2: [5, 1], 0: [0, 5], 4: [1, 0], 1: [1, 4], 3: [3, 1], 5: [2, 1], 6: [1, 3]}
sage: g = graphs.CompleteGraph(5)
sage: g.layout(layout='planar', save_pos=True, test=True, set_embedding=True)
Traceback (most recent call last):
@@ -800,7 +899,7 @@ index cab8faa833..9f00d87eb4 100644
"""
import networkx
-@@ -7107,7 +7107,7 @@ class Graph(GenericGraph):
+@@ -7147,7 +7147,7 @@ class Graph(GenericGraph):
Vertices may be arbitrary --- check that :trac:`24898` is fixed::
sage: Graph({(1,2):[(2,3)],(2,3):[(1,2)]}).modular_decomposition()
@@ -850,8 +949,8 @@ index dc11b61e4d..24090589d4 100644
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]}
-+ {0: [0, 5], 1: [5, 1], 2: [1, 0], 3: [2, 1], 4: [1, 3], 5: [2, 2], 6: [4, 1]}
+- {1: [5, 1], 0: [0, 5], 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: [2, 1], 4: [1, 3], 5: [2, 2], 6: [4, 1]}
"""
tree_nodes, (v1, v2, v3) = x
@@ -1181,7 +1280,7 @@ diff --git a/src/sage/parallel/map_reduce.py b/src/sage/parallel/map_reduce.py
index 0fb6091cbd..c2f7e77727 100644
--- a/src/sage/parallel/map_reduce.py
+++ b/src/sage/parallel/map_reduce.py
-@@ -1396,7 +1396,7 @@ class RESetMapReduce(object):
+@@ -1402,7 +1402,7 @@ class RESetMapReduce(object):
sage: EX = RESetMPExample(maxl=6)
sage: EX.setup_workers(2)
sage: EX.random_worker()
@@ -1190,7 +1289,7 @@ index 0fb6091cbd..c2f7e77727 100644
sage: EX.random_worker() in EX._workers
True
-@@ -1580,7 +1580,7 @@ class RESetMapReduceWorker(mp.Process):
+@@ -1586,7 +1586,7 @@ class RESetMapReduceWorker(mp.Process):
sage: from sage.parallel.map_reduce import RESetMPExample, RESetMapReduceWorker
sage: EX = RESetMPExample()
sage: RESetMapReduceWorker(EX, 200, True)
@@ -1492,6 +1591,27 @@ index 9818f2ada9..ebb3c0121a 100644
"""
#*****************************************************************************
+@@ -587,7 +587,7 @@ class SchemeMorphism_orbit_closure_toric_variety(SchemeMorphism, Morphism):
+ TESTS::
+
+ sage: V.embedding_morphism()._reverse_ray_map()
+- {N(1): 2, N(-1): 3}
++ {N(-1): 3, N(1): 2}
+ sage: V.embedding_morphism()._defining_cone
+ 1-d cone of Rational polyhedral fan in 2-d lattice N
+ """
+@@ -647,9 +647,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(0, 1): (1), N(1, 0): (0), N(-1, -2): (-2)}
++ {N(1, 0): (0), N(-1, -2): (-2), N(0, 1): (1)}
+ sage: f._reverse_ray_map()
+- {N(1): 1, N(-2): 2}
++ {N(-2): 2, N(1): 1}
+ """
+ orbit = self.parent().domain()
+ codomain_fan = self.parent().codomain().fan()
@@ -714,7 +714,7 @@ class SchemeMorphism_orbit_closure_toric_variety(SchemeMorphism, Morphism):
From: 1-d toric variety covered by 2 affine patches
To: 2-d CPR-Fano toric variety covered by 3 affine patches
@@ -1528,7 +1648,16 @@ index 9818f2ada9..ebb3c0121a 100644
"""
phi_i, phi_b, phi_s = self.fan_morphism().factor()
from sage.schemes.toric.all import ToricVariety
-@@ -1952,8 +1952,8 @@ class SchemeMorphism_fan_fiber_component_toric_variety(SchemeMorphism):
+@@ -1815,7 +1815,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): 2, N(-1): 3}
++ {N(-1): 3, N(1): 2}
+
+ TESTS::
+
+@@ -1952,10 +1952,10 @@ class SchemeMorphism_fan_fiber_component_toric_variety(SchemeMorphism):
sage: for r in fc.fan().rays():
....: print("{} {}".format(r, f._image_ray_multiplicity(r)))
N(0, 1) (5, 1)
@@ -1536,8 +1665,11 @@ index 9818f2ada9..ebb3c0121a 100644
N(-1, 2) (11, 1)
+ N(1, -3) (9, 2)
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}
++ {N(1, 0): 4, N(0, 1): 5, N(-3, 4): 10, N(2, -6): 9, N(-1, 2): 11}
"""
+ try:
+ image_ray_index = self._ray_index_map[fiber_ray]
@@ -1999,7 +1999,7 @@ class SchemeMorphism_fan_fiber_component_toric_variety(SchemeMorphism):
V(z0) + V(z1) + 3*V(z2) + 4*V(z3)
sage: fc = f.fiber_component(Cone([(1,1,0)]))
@@ -1676,7 +1808,7 @@ diff --git a/src/sage/repl/preparse.py b/src/sage/repl/preparse.py
index 529c341833..25223123d1 100644
--- a/src/sage/repl/preparse.py
+++ b/src/sage/repl/preparse.py
-@@ -791,7 +791,7 @@ def preparse_numeric_literals(code, extract=False):
+@@ -805,7 +805,7 @@ def preparse_numeric_literals(code, extract=False):
sage: 123__45 # py3
Traceback (most recent call last):
...
@@ -1685,7 +1817,7 @@ index 529c341833..25223123d1 100644
sage: preparse_numeric_literals('3040_1_')
'3040_1_'
-@@ -802,7 +802,7 @@ def preparse_numeric_literals(code, extract=False):
+@@ -816,7 +816,7 @@ def preparse_numeric_literals(code, extract=False):
sage: 3040_1_ # py3
Traceback (most recent call last):
...
diff --git a/sagemath-singular-4.1.2.patch b/sagemath-singular-4.1.2.patch
index cc9253b60507..0bc72c46aa4d 100644
--- a/sagemath-singular-4.1.2.patch
+++ b/sagemath-singular-4.1.2.patch
@@ -1,3 +1,4 @@
+diff --git a/src/doc/en/constructions/algebraic_geometry.rst b/src/doc/en/constructions/algebraic_geometry.rst
index a312548..d1c9c95 100644
--- a/src/doc/en/constructions/algebraic_geometry.rst
+++ b/src/doc/en/constructions/algebraic_geometry.rst
@@ -36,7 +37,7 @@ index ee71373..799f16f 100644
From looking at the output, notice that our wrapper function will need
diff --git a/src/sage/algebras/free_algebra.py b/src/sage/algebras/free_algebra.py
-index c24add0..25e84ff 100644
+index 2ba6b72..926ca07 100644
--- a/src/sage/algebras/free_algebra.py
+++ b/src/sage/algebras/free_algebra.py
@@ -39,7 +39,15 @@ two-sided ideals, and thus provide ideal containment tests::
@@ -429,7 +430,7 @@ index d7214d1..5b8cf48 100644
libsingular_options['redSB'] = bck[1]
self.__GB = A.ideal(out,side='twosided',coerce=False)
diff --git a/src/sage/combinat/root_system/hecke_algebra_representation.py b/src/sage/combinat/root_system/hecke_algebra_representation.py
-index 7c4f64a..24750be 100644
+index 51f4113..ba42ed1 100644
--- a/src/sage/combinat/root_system/hecke_algebra_representation.py
+++ b/src/sage/combinat/root_system/hecke_algebra_representation.py
@@ -746,7 +746,7 @@ class HeckeAlgebraRepresentation(WithEqualityById, SageObject):
@@ -512,7 +513,7 @@ index 0d32a8d..5e48f87 100644
return self( self._s(left)*self._s(right) )
diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py
-index 2f08a9d..dbf9b13 100644
+index 78e65d0..bf02916 100644
--- a/src/sage/interfaces/singular.py
+++ b/src/sage/interfaces/singular.py
@@ -191,13 +191,21 @@ The 1x1 and 2x2 minors::
@@ -540,7 +541,7 @@ index 2f08a9d..dbf9b13 100644
::
diff --git a/src/sage/libs/singular/function.pyx b/src/sage/libs/singular/function.pyx
-index b649ab1..3742260 100644
+index b649ab1..a405ab2 100644
--- a/src/sage/libs/singular/function.pyx
+++ b/src/sage/libs/singular/function.pyx
@@ -1257,7 +1257,7 @@ cdef class SingularFunction(SageObject):
@@ -552,6 +553,15 @@ index b649ab1..3742260 100644
sage: size('foobar', ring=P)
6
+@@ -1308,7 +1308,7 @@ cdef class SingularFunction(SageObject):
+ ...
+ RuntimeError: error in Singular function call 'triangL':
+ The input is no groebner basis.
+- leaving triang.lib::triangL
++ leaving triang.lib::triangL (0)
+
+ Flush any stray output -- see :trac:`28622`::
+
@@ -1671,17 +1671,17 @@ def singular_function(name):
Traceback (most recent call last):
...
@@ -573,6 +583,28 @@ index b649ab1..3742260 100644
The Singular function ``list`` can be called with any number of
arguments::
+diff --git a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
+index 8b03d22..c5cd87b 100644
+--- a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
++++ b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
+@@ -1580,7 +1580,7 @@ class FractionWithFactoredDenominator(RingElement):
+ (1, [(x*y + x + y - 1, 2)])
+ sage: alpha = [4, 3]
+ sage: decomp = F.asymptotic_decomposition(alpha); decomp
+- (0, []) + (-3/2*r*(1/y + 1) - 1/2/y - 1/2, [(x*y + x + y - 1, 1)])
++ (0, []) + (-2*r*(1/x + 1) - 1/2/x - 1/2, [(x*y + x + y - 1, 1)])
+ sage: F1 = decomp[1]
+ sage: p = {y: 1/3, x: 1/2}
+ sage: asy = F1.asymptotics(p, alpha, 2, verbose=True)
+@@ -1614,7 +1614,7 @@ class FractionWithFactoredDenominator(RingElement):
+ sage: alpha = [3, 3, 2]
+ sage: decomp = F.asymptotic_decomposition(alpha); decomp
+ (0, []) +
+- (-16*r*(3/y - 4/z) - 16/y + 32/z,
++ (16*r*(3/x - 2/z) + 16/x - 16/z,
+ [(x + 2*y + z - 4, 1), (2*x + y + z - 4, 1)])
+ sage: F1 = decomp[1]
+ sage: p = {x: 1, y: 1, z: 1}
diff --git a/src/sage/rings/polynomial/multi_polynomial_element.py b/src/sage/rings/polynomial/multi_polynomial_element.py
index e5d6921..f4027eb 100644
--- a/src/sage/rings/polynomial/multi_polynomial_element.py
@@ -587,7 +619,7 @@ index e5d6921..f4027eb 100644
-1
sage: degree_lowest_rational_function(r,b)
diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py
-index 767f3ae..09a2306e 100644
+index 962205f..1c9a81d 100644
--- a/src/sage/rings/polynomial/multi_polynomial_ideal.py
+++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py
@@ -170,7 +170,7 @@ when the system has no solutions over the rationals.
@@ -624,10 +656,10 @@ index 767f3ae..09a2306e 100644
10*b*c + 12*c^2 - b - 4*c,
a + 2*b + 2*c - 1]
diff --git a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-index fd03639..851f1b2 100644
+index ab18796..868ca8c 100644
--- a/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
+++ b/src/sage/rings/polynomial/multi_polynomial_libsingular.pyx
-@@ -2587,6 +2587,26 @@ cdef class MPolynomial_libsingular(MPolynomial):
+@@ -2549,6 +2549,26 @@ cdef class MPolynomial_libsingular(MPolynomial):
"""
return singular_polynomial_str_with_changed_varnames(self._poly, self._parent_ring, varnames)
@@ -655,10 +687,10 @@ index fd03639..851f1b2 100644
"""
Return the degree of this polynomial.
diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
-index d2dec78..6fa2680 100644
+index 42001d4..8e4eea9 100644
--- a/src/sage/rings/polynomial/plural.pyx
+++ b/src/sage/rings/polynomial/plural.pyx
-@@ -2876,7 +2876,8 @@ cpdef MPolynomialRing_libsingular new_CRing(RingWrap rw, base_ring):
+@@ -2888,7 +2888,8 @@ cpdef MPolynomialRing_libsingular new_CRing(RingWrap rw, base_ring):
self.__ngens = rw.ngens()
self.__term_order = TermOrder(rw.ordering_string(), force=True)
@@ -681,16 +713,3 @@ index 592bb68..962821c 100644
.. NOTE::
-diff --git a/src/sage/libs/singular/function.pyx b/src/sage/libs/singular/function.pyx
-index b649ab1e64..72f34fd67d 100644
---- a/src/sage/libs/singular/function.pyx
-+++ b/src/sage/libs/singular/function.pyx
-@@ -1308,7 +1308,7 @@ cdef class SingularFunction(SageObject):
- ...
- RuntimeError: error in Singular function call 'triangL':
- The input is no groebner basis.
-- leaving triang.lib::triangL
-+ leaving triang.lib::triangL (0)
-
- Flush any stray output -- see :trac:`28622`::
-