summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen Demeyer <jdemeyer@cage.ugent.be>2017-05-30 10:53:27 +0200
committerJeroen Demeyer <jdemeyer@cage.ugent.be>2017-05-30 16:56:43 +0200
commit256bf191ab0472303bb11e105a246106e894c4ec (patch)
tree403595c9e81ca2743d624d319cc6975a9adc70ee
parentUpdated SageMath version to 8.0.beta8 (diff)
Move richcmp stuff to new file richcmp.pyx
-rw-r--r--src/doc/en/reference/structure/index.rst1
-rw-r--r--src/doc/en/thematic_tutorials/coercion_and_categories.rst4
-rw-r--r--src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_ideal.py4
-rw-r--r--src/sage/algebras/free_algebra_element.py2
-rw-r--r--src/sage/algebras/free_algebra_quotient_element.py2
-rw-r--r--src/sage/algebras/lie_algebras/lie_algebra_element.pyx2
-rw-r--r--src/sage/algebras/weyl_algebra.py2
-rw-r--r--src/sage/categories/morphism.pyx2
-rw-r--r--src/sage/combinat/alternating_sign_matrix.py2
-rw-r--r--src/sage/combinat/constellation.py22
-rw-r--r--src/sage/combinat/crystals/affine.py2
-rw-r--r--src/sage/combinat/crystals/affinization.py2
-rw-r--r--src/sage/combinat/crystals/alcove_path.py2
-rw-r--r--src/sage/combinat/crystals/fast_crystals.py2
-rw-r--r--src/sage/combinat/crystals/pbw_crystal.py2
-rw-r--r--src/sage/combinat/crystals/subcrystal.py2
-rw-r--r--src/sage/combinat/fully_packed_loop.py2
-rw-r--r--src/sage/combinat/interval_posets.py2
-rw-r--r--src/sage/combinat/rigged_configurations/kleber_tree.py2
-rw-r--r--src/sage/combinat/root_system/weyl_group.py2
-rw-r--r--src/sage/combinat/words/word_char.pyx2
-rw-r--r--src/sage/crypto/mq/sr.py2
-rw-r--r--src/sage/data_structures/bounded_integer_sequences.pyx2
-rw-r--r--src/sage/ext/fast_eval.pyx2
-rw-r--r--src/sage/geometry/hyperbolic_space/hyperbolic_point.py2
-rw-r--r--src/sage/geometry/linear_expression.py2
-rw-r--r--src/sage/geometry/newton_polygon.py2
-rw-r--r--src/sage/geometry/point_collection.pyx2
-rw-r--r--src/sage/geometry/toric_lattice_element.pyx2
-rw-r--r--src/sage/groups/braid.py2
-rw-r--r--src/sage/groups/libgap_wrapper.pyx2
-rw-r--r--src/sage/groups/matrix_gps/group_element.pyx2
-rw-r--r--src/sage/groups/perm_gps/permgroup_element.pyx2
-rw-r--r--src/sage/homology/hochschild_complex.py2
-rw-r--r--src/sage/libs/singular/function.pyx3
-rw-r--r--src/sage/libs/singular/groebner_strategy.pyx2
-rw-r--r--src/sage/matrix/matrix_dense.pyx2
-rw-r--r--src/sage/matrix/matrix_sparse.pyx2
-rw-r--r--src/sage/misc/constant_function.pyx14
-rw-r--r--src/sage/modular/arithgroup/arithgroup_element.pyx2
-rw-r--r--src/sage/modular/arithgroup/farey_symbol.pyx2
-rw-r--r--src/sage/modular/btquotients/pautomorphicform.py2
-rw-r--r--src/sage/modular/cusps.py2
-rw-r--r--src/sage/modular/cusps_nf.py2
-rw-r--r--src/sage/modular/dirichlet.py2
-rw-r--r--src/sage/modular/hecke/element.py2
-rw-r--r--src/sage/modular/modform_hecketriangle/graded_ring_element.py2
-rw-r--r--src/sage/modular/modsym/manin_symbol.pyx2
-rw-r--r--src/sage/modular/pollack_stevens/dist.pyx4
-rw-r--r--src/sage/modular/pollack_stevens/modsym.py2
-rw-r--r--src/sage/modular/pollack_stevens/sigma0.py2
-rw-r--r--src/sage/modules/fg_pid/fgp_element.py2
-rw-r--r--src/sage/modules/free_module_element.pyx2
-rw-r--r--src/sage/modules/with_basis/indexed_element.pyx2
-rw-r--r--src/sage/modules/with_basis/morphism.py2
-rw-r--r--src/sage/monoids/free_abelian_monoid_element.py2
-rw-r--r--src/sage/monoids/indexed_free_monoid.py2
-rw-r--r--src/sage/monoids/string_monoid_element.py2
-rw-r--r--src/sage/quivers/algebra_elements.pxi2
-rw-r--r--src/sage/quivers/algebra_elements.pyx2
-rw-r--r--src/sage/quivers/paths.pyx2
-rw-r--r--src/sage/rings/asymptotic/misc.py2
-rw-r--r--src/sage/rings/complex_double.pyx2
-rw-r--r--src/sage/rings/complex_mpc.pyx2
-rw-r--r--src/sage/rings/finite_rings/element_givaro.pyx3
-rw-r--r--src/sage/rings/finite_rings/element_ntl_gf2e.pyx5
-rw-r--r--src/sage/rings/finite_rings/residue_field.pyx2
-rw-r--r--src/sage/rings/fraction_field_element.pyx2
-rw-r--r--src/sage/rings/function_field/function_field_element.pyx2
-rw-r--r--src/sage/rings/integer.pyx3
-rw-r--r--src/sage/rings/integer_ring.pyx2
-rw-r--r--src/sage/rings/laurent_series_ring_element.pyx2
-rw-r--r--src/sage/rings/morphism.pyx4
-rw-r--r--src/sage/rings/multi_power_series_ring_element.py2
-rw-r--r--src/sage/rings/number_field/number_field_element.pyx2
-rw-r--r--src/sage/rings/number_field/number_field_element_quadratic.pyx2
-rw-r--r--src/sage/rings/padics/morphism.pyx4
-rw-r--r--src/sage/rings/padics/padic_base_leaves.py2
-rw-r--r--src/sage/rings/padics/padic_extension_generic.py2
-rw-r--r--src/sage/rings/padics/padic_printing.pyx2
-rw-r--r--src/sage/rings/padics/pow_computer.pyx2
-rw-r--r--src/sage/rings/padics/pow_computer_flint.pyx2
-rw-r--r--src/sage/rings/polynomial/laurent_polynomial.pyx2
-rw-r--r--src/sage/rings/polynomial/multi_polynomial_libsingular.pyx2
-rw-r--r--src/sage/rings/polynomial/multi_polynomial_ring_generic.pyx2
-rw-r--r--src/sage/rings/polynomial/pbori.pyx2
-rw-r--r--src/sage/rings/polynomial/polynomial_element.pyx2
-rw-r--r--src/sage/rings/polynomial/polynomial_element_generic.py4
-rw-r--r--src/sage/rings/polynomial/polynomial_template.pxi2
-rw-r--r--src/sage/rings/polynomial/symmetric_reduction.pyx2
-rw-r--r--src/sage/rings/power_series_ring_element.pyx2
-rw-r--r--src/sage/rings/qqbar.py9
-rw-r--r--src/sage/rings/real_double.pyx2
-rw-r--r--src/sage/rings/real_lazy.pyx2
-rw-r--r--src/sage/rings/real_mpfi.pyx2
-rw-r--r--src/sage/rings/real_mpfr.pyx2
-rw-r--r--src/sage/rings/universal_cyclotomic_field.py2
-rw-r--r--src/sage/schemes/elliptic_curves/ell_curve_isogeny.py2
-rw-r--r--src/sage/schemes/elliptic_curves/ell_point.py2
-rw-r--r--src/sage/schemes/generic/morphism.py2
-rw-r--r--src/sage/schemes/generic/point.py2
-rw-r--r--src/sage/schemes/product_projective/point.py2
-rw-r--r--src/sage/schemes/projective/projective_point.py2
-rw-r--r--src/sage/schemes/toric/morphism.py2
-rw-r--r--src/sage/structure/coerce.pyx5
-rw-r--r--src/sage/structure/element.pyx4
-rw-r--r--src/sage/structure/list_clone.pyx2
-rw-r--r--src/sage/structure/parent.pyx3
-rw-r--r--src/sage/structure/richcmp.pxd146
-rw-r--r--src/sage/structure/richcmp.pyx89
-rw-r--r--src/sage/structure/sage_object.pxd159
-rw-r--r--src/sage/structure/sage_object.pyx65
-rw-r--r--src/sage/symbolic/function.pyx2
-rw-r--r--src/sage/tests/stl_vector.pyx2
114 files changed, 440 insertions, 301 deletions
diff --git a/src/doc/en/reference/structure/index.rst b/src/doc/en/reference/structure/index.rst
index 8bbbdf0..a24b481 100644
--- a/src/doc/en/reference/structure/index.rst
+++ b/src/doc/en/reference/structure/index.rst
@@ -74,6 +74,7 @@ Utilities
.. toctree::
:maxdepth: 1
+ sage/structure/richcmp
sage/structure/unique_representation
sage/structure/factory
sage/structure/dynamic_class
diff --git a/src/doc/en/thematic_tutorials/coercion_and_categories.rst b/src/doc/en/thematic_tutorials/coercion_and_categories.rst
index 8cbbe2e..6b4c546 100644
--- a/src/doc/en/thematic_tutorials/coercion_and_categories.rst
+++ b/src/doc/en/thematic_tutorials/coercion_and_categories.rst
@@ -367,7 +367,7 @@ This gives rise to the following code::
....: def _repr_(self):
....: return "(%s):(%s)"%(self.n,self.d)
....: def _richcmp_(self, other, op):
- ....: from sage.structure.sage_object import richcmp
+ ....: from sage.structure.richcmp import richcmp
....: return richcmp(self.n*other.denominator(), other.numerator()*self.d, op)
....: def _add_(self, other):
....: C = self.__class__
@@ -1858,7 +1858,7 @@ Appendix: The complete code
# are allowed to use the denominator() and numerator() methods
# on the second argument.
def _richcmp_(self, other, op):
- from sage.structure.sage_object import richcmp
+ from sage.structure.richcmp import richcmp
return richcmp(self.n*other.denominator(), other.numerator()*self.d, op)
# Arithmetic methods, single underscore. We can assume that both
diff --git a/src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_ideal.py b/src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_ideal.py
index 52969d5..f2541a0 100644
--- a/src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_ideal.py
+++ b/src/sage/algebras/finite_dimensional_algebras/finite_dimensional_algebra_ideal.py
@@ -24,8 +24,8 @@ from sage.structure.sage_object import SageObject
from sage.misc.cachefunc import cached_method
from functools import reduce
-from sage.structure.sage_object import (op_LT, op_LE, op_EQ, op_NE,
- op_GT, op_GE)
+from sage.structure.richcmp import (op_LT, op_LE, op_EQ, op_NE,
+ op_GT, op_GE)
class FiniteDimensionalAlgebraIdeal(Ideal_generic):
diff --git a/src/sage/algebras/free_algebra_element.py b/src/sage/algebras/free_algebra_element.py
index b719b53..9aaa39f 100644
--- a/src/sage/algebras/free_algebra_element.py
+++ b/src/sage/algebras/free_algebra_element.py
@@ -40,7 +40,7 @@ from sage.monoids.free_monoid_element import FreeMonoidElement
from sage.modules.with_basis.indexed_element import IndexedFreeModuleElement
from sage.combinat.free_module import CombinatorialFreeModule
from sage.structure.element import AlgebraElement
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
import six
diff --git a/src/sage/algebras/free_algebra_quotient_element.py b/src/sage/algebras/free_algebra_quotient_element.py
index 441670d..a44d42e 100644
--- a/src/sage/algebras/free_algebra_quotient_element.py
+++ b/src/sage/algebras/free_algebra_quotient_element.py
@@ -26,7 +26,7 @@ from six import integer_types
from sage.misc.misc import repr_lincomb
from sage.structure.element import RingElement, AlgebraElement
from sage.structure.parent_gens import localvars
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
from sage.rings.integer import Integer
from sage.modules.free_module_element import FreeModuleElement
from sage.monoids.free_monoid_element import FreeMonoidElement
diff --git a/src/sage/algebras/lie_algebras/lie_algebra_element.pyx b/src/sage/algebras/lie_algebras/lie_algebra_element.pyx
index 1162172..7f7a0ec 100644
--- a/src/sage/algebras/lie_algebras/lie_algebra_element.pyx
+++ b/src/sage/algebras/lie_algebras/lie_algebra_element.pyx
@@ -24,7 +24,7 @@ from sage.misc.misc import repr_lincomb
from sage.combinat.free_module import CombinatorialFreeModule
from sage.structure.element cimport have_same_parent, coercion_model, parent
from sage.structure.element_wrapper cimport ElementWrapper
-from sage.structure.sage_object cimport richcmp
+from sage.structure.richcmp cimport richcmp
from sage.data_structures.blas_dict cimport axpy, negate, scal
# TODO: Inherit from IndexedFreeModuleElement and make cdef once #22632 is merged
diff --git a/src/sage/algebras/weyl_algebra.py b/src/sage/algebras/weyl_algebra.py
index daafa6d..da118c0 100644
--- a/src/sage/algebras/weyl_algebra.py
+++ b/src/sage/algebras/weyl_algebra.py
@@ -18,7 +18,7 @@ AUTHORS:
from sage.misc.cachefunc import cached_method
from sage.misc.latex import latex
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
from sage.structure.element import AlgebraElement
from sage.structure.unique_representation import UniqueRepresentation
from copy import copy
diff --git a/src/sage/categories/morphism.pyx b/src/sage/categories/morphism.pyx
index eae6483..c449ba4 100644
--- a/src/sage/categories/morphism.pyx
+++ b/src/sage/categories/morphism.pyx
@@ -29,7 +29,7 @@ import operator
import homset
from sage.structure.element cimport Element
-from sage.structure.sage_object cimport richcmp_not_equal, rich_to_bool
+from sage.structure.richcmp cimport richcmp_not_equal, rich_to_bool
def is_Morphism(x):
return isinstance(x, Morphism)
diff --git a/src/sage/combinat/alternating_sign_matrix.py b/src/sage/combinat/alternating_sign_matrix.py
index 3cafa2d..7261164 100644
--- a/src/sage/combinat/alternating_sign_matrix.py
+++ b/src/sage/combinat/alternating_sign_matrix.py
@@ -40,7 +40,7 @@ from sage.misc.all import prod
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent
from sage.structure.element import Element
-from sage.structure.sage_object import op_NE, richcmp
+from sage.structure.richcmp import op_NE, richcmp
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
from sage.matrix.matrix_space import MatrixSpace
from sage.matrix.constructor import matrix
diff --git a/src/sage/combinat/constellation.py b/src/sage/combinat/constellation.py
index fc45e5e..b7e5c79 100644
--- a/src/sage/combinat/constellation.py
+++ b/src/sage/combinat/constellation.py
@@ -41,14 +41,18 @@ REFERENCES:
.. [LaZv04] S. Lando and A. Zvonkine, "Graphs on surfaces and their
applications", Springer-Verlag, 2004.
"""
-# *************************************************************************
-# Copyright (C) 2015-2016 Vincent Delecroix <20100.delecroix@gmail.com>
-# Frederic Chapoton <fchapoton2@gmail.com>
-#
-# Distributed under the terms of the GNU General Public License (GPL)
+
+#*****************************************************************************
+# Copyright (C) 2015-2016 Vincent Delecroix <20100.delecroix@gmail.com>
+# Frederic Chapoton <fchapoton2@gmail.com>
#
-# The full text of the GPL is available at http://www.gnu.org/licenses/
-# *************************************************************************
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+# http://www.gnu.org/licenses/
+#*****************************************************************************
+
from six.moves import range
from six import integer_types
@@ -56,8 +60,8 @@ from sage.structure.element import parent
from sage.structure.parent import Parent
from sage.structure.element import Element
from sage.structure.unique_representation import UniqueRepresentation
-from sage.structure.sage_object import (op_NE, op_EQ, richcmp_not_equal,
- rich_to_bool)
+from sage.structure.richcmp import (op_NE, op_EQ, richcmp_not_equal,
+ rich_to_bool)
from sage.groups.perm_gps.permgroup_named import SymmetricGroup
from sage.rings.integer import Integer
diff --git a/src/sage/combinat/crystals/affine.py b/src/sage/combinat/crystals/affine.py
index 286784f..ff18f28 100644
--- a/src/sage/combinat/crystals/affine.py
+++ b/src/sage/combinat/crystals/affine.py
@@ -19,7 +19,7 @@ from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element_wrapper import ElementWrapper
from sage.combinat.root_system.cartan_type import CartanType
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
class AffineCrystalFromClassical(UniqueRepresentation, Parent):
diff --git a/src/sage/combinat/crystals/affinization.py b/src/sage/combinat/crystals/affinization.py
index e1dbce2..e89f37f 100644
--- a/src/sage/combinat/crystals/affinization.py
+++ b/src/sage/combinat/crystals/affinization.py
@@ -21,7 +21,7 @@ from sage.structure.element import parent
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.element import Element
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
from sage.categories.regular_crystals import RegularCrystals
from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets
from sage.rings.infinity import Infinity
diff --git a/src/sage/combinat/crystals/alcove_path.py b/src/sage/combinat/crystals/alcove_path.py
index 3a766a8..6baeae9 100644
--- a/src/sage/combinat/crystals/alcove_path.py
+++ b/src/sage/combinat/crystals/alcove_path.py
@@ -27,7 +27,7 @@ from sage.structure.parent import Parent
from sage.structure.element import Element
from sage.structure.element_wrapper import ElementWrapper
from sage.structure.unique_representation import UniqueRepresentation
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
from sage.categories.finite_crystals import FiniteCrystals
from sage.categories.classical_crystals import ClassicalCrystals
from sage.categories.loop_crystals import LoopCrystals
diff --git a/src/sage/combinat/crystals/fast_crystals.py b/src/sage/combinat/crystals/fast_crystals.py
index 6e1976c..c007c4d 100644
--- a/src/sage/combinat/crystals/fast_crystals.py
+++ b/src/sage/combinat/crystals/fast_crystals.py
@@ -25,7 +25,7 @@ from sage.structure.parent import Parent
from sage.categories.classical_crystals import ClassicalCrystals
from sage.structure.element import Element, parent
from sage.combinat.root_system.cartan_type import CartanType
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
class FastCrystal(UniqueRepresentation, Parent):
diff --git a/src/sage/combinat/crystals/pbw_crystal.py b/src/sage/combinat/crystals/pbw_crystal.py
index 4edb357..42467d2 100644
--- a/src/sage/combinat/crystals/pbw_crystal.py
+++ b/src/sage/combinat/crystals/pbw_crystal.py
@@ -26,7 +26,7 @@ from sage.misc.cachefunc import cached_method
from sage.structure.element import Element
from sage.structure.parent import Parent
from sage.structure.unique_representation import UniqueRepresentation
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
from sage.categories.highest_weight_crystals import HighestWeightCrystals
from sage.categories.infinite_enumerated_sets import InfiniteEnumeratedSets
from sage.combinat.root_system.cartan_type import CartanType
diff --git a/src/sage/combinat/crystals/subcrystal.py b/src/sage/combinat/crystals/subcrystal.py
index 476fa40..c1bfd52 100644
--- a/src/sage/combinat/crystals/subcrystal.py
+++ b/src/sage/combinat/crystals/subcrystal.py
@@ -33,7 +33,7 @@ from sage.categories.finite_crystals import FiniteCrystals
from sage.combinat.root_system.cartan_type import CartanType
from sage.rings.integer import Integer
from sage.rings.infinity import infinity
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
class Subcrystal(UniqueRepresentation, Parent):
diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
index 956059f..b39ab4f 100644
--- a/src/sage/combinat/fully_packed_loop.py
+++ b/src/sage/combinat/fully_packed_loop.py
@@ -9,7 +9,7 @@ from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent
from sage.structure.element import Element
-from sage.structure.sage_object import op_EQ, op_NE
+from sage.structure.richcmp import op_EQ, op_NE
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
from sage.combinat.six_vertex_model import (SquareIceModel,
diff --git a/src/sage/combinat/interval_posets.py b/src/sage/combinat/interval_posets.py
index 20dc94d..fcd2d25 100644
--- a/src/sage/combinat/interval_posets.py
+++ b/src/sage/combinat/interval_posets.py
@@ -84,7 +84,7 @@ from sage.sets.family import Family
from sage.structure.element import Element
from sage.structure.global_options import GlobalOptions
from sage.structure.parent import Parent
-from sage.structure.sage_object import op_NE, op_EQ, op_LT, op_LE, op_GT, op_GE
+from sage.structure.richcmp import op_NE, op_EQ, op_LT, op_LE, op_GT, op_GE
from sage.structure.unique_representation import UniqueRepresentation
from sage.graphs.digraph import DiGraph
diff --git a/src/sage/combinat/rigged_configurations/kleber_tree.py b/src/sage/combinat/rigged_configurations/kleber_tree.py
index eedd0ad..abb7dfe 100644
--- a/src/sage/combinat/rigged_configurations/kleber_tree.py
+++ b/src/sage/combinat/rigged_configurations/kleber_tree.py
@@ -78,7 +78,7 @@ from sage.rings.all import ZZ
from sage.structure.parent import Parent
from sage.structure.element import Element
from sage.structure.unique_representation import UniqueRepresentation
-from sage.structure.sage_object import richcmp_not_equal, richcmp
+from sage.structure.richcmp import richcmp_not_equal, richcmp
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
from sage.modules.free_module import FreeModule
diff --git a/src/sage/combinat/root_system/weyl_group.py b/src/sage/combinat/root_system/weyl_group.py
index d00fb12..4ae3ca7 100644
--- a/src/sage/combinat/root_system/weyl_group.py
+++ b/src/sage/combinat/root_system/weyl_group.py
@@ -49,7 +49,7 @@ from sage.combinat.root_system.reflection_group_element import RealReflectionGro
from sage.matrix.constructor import matrix, diagonal_matrix
from sage.combinat.root_system.root_lattice_realizations import RootLatticeRealizations
from sage.structure.unique_representation import UniqueRepresentation
-from sage.structure.sage_object import richcmp, richcmp_not_equal
+from sage.structure.richcmp import richcmp, richcmp_not_equal
from sage.categories.all import WeylGroups, FiniteWeylGroups, AffineWeylGroups
from sage.categories.permutation_groups import PermutationGroups
from sage.sets.family import Family
diff --git a/src/sage/combinat/words/word_char.pyx b/src/sage/combinat/words/word_char.pyx
index 9506db0..5b5b98a 100644
--- a/src/sage/combinat/words/word_char.pyx
+++ b/src/sage/combinat/words/word_char.pyx
@@ -22,7 +22,7 @@ from sage.rings.integer cimport Integer, smallInteger
from sage.rings.rational cimport Rational
from libc.string cimport memcpy, memcmp
from sage.combinat.words.word_datatypes cimport WordDatatype
-from sage.structure.sage_object cimport rich_to_bool
+from sage.structure.richcmp cimport rich_to_bool
from cpython.number cimport PyIndex_Check, PyNumber_Check
from cpython.sequence cimport PySequence_Check
diff --git a/src/sage/crypto/mq/sr.py b/src/sage/crypto/mq/sr.py
index d9df6818..c9f8ac4 100644
--- a/src/sage/crypto/mq/sr.py
+++ b/src/sage/crypto/mq/sr.py
@@ -326,7 +326,7 @@ from sage.rings.polynomial.multi_polynomial_sequence import PolynomialSequence
from .mpolynomialsystemgenerator import MPolynomialSystemGenerator
from sage.rings.polynomial.term_order import TermOrder
-from sage.structure.sage_object import richcmp_not_equal, rich_to_bool, op_LT
+from sage.structure.richcmp import richcmp_not_equal, rich_to_bool, op_LT
def SR(n=1, r=1, c=1, e=4, star=False, **kwargs):
diff --git a/src/sage/data_structures/bounded_integer_sequences.pyx b/src/sage/data_structures/bounded_integer_sequences.pyx
index a03836f..0f7b387 100644
--- a/src/sage/data_structures/bounded_integer_sequences.pyx
+++ b/src/sage/data_structures/bounded_integer_sequences.pyx
@@ -115,7 +115,7 @@ from cpython.int cimport PyInt_FromSize_t
from cpython.slice cimport PySlice_GetIndicesEx
from sage.libs.gmp.mpn cimport mpn_rshift, mpn_lshift, mpn_copyi, mpn_ior_n, mpn_zero, mpn_copyd, mpn_cmp
from sage.libs.flint.flint cimport FLINT_BIT_COUNT as BIT_COUNT
-from sage.structure.sage_object cimport richcmp_not_equal, rich_to_bool
+from sage.structure.richcmp cimport richcmp_not_equal, rich_to_bool
cimport cython
diff --git a/src/sage/ext/fast_eval.pyx b/src/sage/ext/fast_eval.pyx
index 6513ac9..b10d130 100644
--- a/src/sage/ext/fast_eval.pyx
+++ b/src/sage/ext/fast_eval.pyx
@@ -89,7 +89,7 @@ AUTHORS:
from sage.ext.fast_callable import fast_callable, Wrapper
-from sage.structure.sage_object cimport richcmp_not_equal, rich_to_bool
+from sage.structure.richcmp cimport richcmp_not_equal, rich_to_bool
include "cysignals/memory.pxi"
diff --git a/src/sage/geometry/hyperbolic_space/hyperbolic_point.py b/src/sage/geometry/hyperbolic_space/hyperbolic_point.py
index c18ecc4..f2b862f 100644
--- a/src/sage/geometry/hyperbolic_space/hyperbolic_point.py
+++ b/src/sage/geometry/hyperbolic_space/hyperbolic_point.py
@@ -61,7 +61,7 @@ Some more examples::
#***********************************************************************
from sage.structure.element import Element
-from sage.structure.sage_object import richcmp, op_NE
+from sage.structure.richcmp import richcmp, op_NE
from sage.symbolic.all import I
from sage.misc.latex import latex
from sage.matrix.matrix import is_Matrix
diff --git a/src/sage/geometry/linear_expression.py b/src/sage/geometry/linear_expression.py
index 50b2c74..5a93e06 100644
--- a/src/sage/geometry/linear_expression.py
+++ b/src/sage/geometry/linear_expression.py
@@ -39,7 +39,7 @@ add them and multiply them with scalars::
from six.moves import zip
from sage.structure.parent import Parent
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
from sage.structure.element import ModuleElement
from sage.structure.unique_representation import UniqueRepresentation
from sage.misc.cachefunc import cached_method
diff --git a/src/sage/geometry/newton_polygon.py b/src/sage/geometry/newton_polygon.py
index d8755fa..795692b 100644
--- a/src/sage/geometry/newton_polygon.py
+++ b/src/sage/geometry/newton_polygon.py
@@ -17,7 +17,7 @@ slopes (and hence a last infinite slope).
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent
from sage.structure.element import Element
-from sage.structure.sage_object import op_EQ, op_NE, op_LE, op_GE, op_LT
+from sage.structure.richcmp import op_EQ, op_NE, op_LE, op_GE, op_LT
from sage.misc.cachefunc import cached_method
from sage.rings.infinity import Infinity
diff --git a/src/sage/geometry/point_collection.pyx b/src/sage/geometry/point_collection.pyx
index c901159..b0df2f0 100644
--- a/src/sage/geometry/point_collection.pyx
+++ b/src/sage/geometry/point_collection.pyx
@@ -78,7 +78,7 @@ need to spend time and memory four times.
from __future__ import print_function
from sage.structure.sage_object cimport SageObject
-from sage.structure.sage_object cimport richcmp_not_equal, richcmp
+from sage.structure.richcmp cimport richcmp_not_equal, richcmp
from sage.matrix.all import matrix
from sage.misc.all import latex
diff --git a/src/sage/geometry/toric_lattice_element.pyx b/src/sage/geometry/toric_lattice_element.pyx
index 910edcb..1ca5187 100644
--- a/src/sage/geometry/toric_lattice_element.pyx
+++ b/src/sage/geometry/toric_lattice_element.pyx
@@ -101,7 +101,7 @@ from sage.modules.vector_integer_dense cimport Vector_integer_dense
from sage.structure.coerce_exceptions import CoercionException
from sage.structure.element cimport Element, Vector
from sage.rings.integer cimport Integer
-from sage.structure.sage_object cimport richcmp_not_equal, richcmp
+from sage.structure.richcmp cimport richcmp_not_equal, richcmp
def is_ToricLatticeElement(x):
diff --git a/src/sage/groups/braid.py b/src/sage/groups/braid.py
index 4416858..fa2639b 100644
--- a/src/sage/groups/braid.py
+++ b/src/sage/groups/braid.py
@@ -76,7 +76,7 @@ from sage.categories.action import Action
from sage.sets.set import Set
from sage.groups.finitely_presented import FinitelyPresentedGroup, FinitelyPresentedGroupElement
from sage.misc.package import PackageNotFoundError
-from sage.structure.sage_object import richcmp, rich_to_bool
+from sage.structure.richcmp import richcmp, rich_to_bool
class Braid(FinitelyPresentedGroupElement):
diff --git a/src/sage/groups/libgap_wrapper.pyx b/src/sage/groups/libgap_wrapper.pyx
index f31236b..8f76df8 100644
--- a/src/sage/groups/libgap_wrapper.pyx
+++ b/src/sage/groups/libgap_wrapper.pyx
@@ -65,7 +65,7 @@ from sage.rings.integer_ring import IntegerRing
from sage.misc.cachefunc import cached_method
from sage.structure.sage_object import SageObject
from sage.structure.element cimport Element
-from sage.structure.sage_object cimport richcmp
+from sage.structure.richcmp cimport richcmp
class ParentLibGAP(SageObject):
diff --git a/src/sage/groups/matrix_gps/group_element.pyx b/src/sage/groups/matrix_gps/group_element.pyx
index 6dec90b..dca3f3f 100644
--- a/src/sage/groups/matrix_gps/group_element.pyx
+++ b/src/sage/groups/matrix_gps/group_element.pyx
@@ -78,7 +78,7 @@ from __future__ import print_function
from sage.structure.element cimport MultiplicativeGroupElement, Element, MonoidElement, Matrix
from sage.structure.parent cimport Parent
-from sage.structure.sage_object cimport richcmp
+from sage.structure.richcmp cimport richcmp
from sage.libs.gap.element cimport GapElement, GapElement_List
from sage.groups.libgap_wrapper cimport ElementLibGAP
diff --git a/src/sage/groups/perm_gps/permgroup_element.pyx b/src/sage/groups/perm_gps/permgroup_element.pyx
index 4e91c4b..9337c45 100644
--- a/src/sage/groups/perm_gps/permgroup_element.pyx
+++ b/src/sage/groups/perm_gps/permgroup_element.pyx
@@ -75,7 +75,7 @@ from sage.interfaces.all import gap
from sage.interfaces.gap import is_GapElement
from sage.sets.finite_enumerated_set import FiniteEnumeratedSet
import sage.structure.coerce as coerce
-from sage.structure.sage_object cimport richcmp_not_equal, rich_to_bool
+from sage.structure.richcmp cimport richcmp_not_equal, rich_to_bool
import operator
diff --git a/src/sage/homology/hochschild_complex.py b/src/sage/homology/hochschild_complex.py
index bd5f04b..e463db7 100644
--- a/src/sage/homology/hochschild_complex.py
+++ b/src/sage/homology/hochschild_complex.py
@@ -16,7 +16,7 @@ from sage.misc.cachefunc import cached_method
from sage.structure.unique_representation import UniqueRepresentation
from sage.structure.parent import Parent
from sage.structure.element import ModuleElement, parent
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
from sage.categories.category_types import ChainComplexes
from sage.categories.tensor import tensor
from sage.combinat.free_module import CombinatorialFreeModule
diff --git a/src/sage/libs/singular/function.pyx b/src/sage/libs/singular/function.pyx
index d0c13b8..79c9aa7 100644
--- a/src/sage/libs/singular/function.pyx
+++ b/src/sage/libs/singular/function.pyx
@@ -80,7 +80,8 @@ from libc.string cimport memcpy
include "cysignals/signals.pxi"
-from sage.structure.sage_object cimport SageObject, richcmp
+from sage.structure.sage_object cimport SageObject
+from sage.structure.richcmp cimport richcmp
from sage.rings.integer cimport Integer
diff --git a/src/sage/libs/singular/groebner_strategy.pyx b/src/sage/libs/singular/groebner_strategy.pyx
index 62e002d..4810d3f 100644
--- a/src/sage/libs/singular/groebner_strategy.pyx
+++ b/src/sage/libs/singular/groebner_strategy.pyx
@@ -21,7 +21,7 @@ cdef extern from *: # hack to get at cython macro
int unlikely(int)
int likely(int)
-from sage.structure.sage_object cimport richcmp
+from sage.structure.richcmp cimport richcmp
from sage.libs.singular.decl cimport ideal, ring, poly, currRing
from sage.libs.singular.decl cimport rChangeCurrRing
from sage.libs.singular.decl cimport new_skStrategy, delete_skStrategy, id_RankFreeModule
diff --git a/src/sage/matrix/matrix_dense.pyx b/src/sage/matrix/matrix_dense.pyx
index 7f71a38..0a6b864 100644
--- a/src/sage/matrix/matrix_dense.pyx
+++ b/src/sage/matrix/matrix_dense.pyx
@@ -13,7 +13,7 @@ from __future__ import print_function
cimport sage.matrix.matrix as matrix
from sage.structure.element cimport Element, RingElement
-from sage.structure.sage_object cimport richcmp_not_equal, rich_to_bool
+from sage.structure.richcmp cimport richcmp_not_equal, rich_to_bool
import sage.matrix.matrix_space
import sage.structure.sequence
diff --git a/src/sage/matrix/matrix_sparse.pyx b/src/sage/matrix/matrix_sparse.pyx
index 4cd99ca..27c27c2 100644
--- a/src/sage/matrix/matrix_sparse.pyx
+++ b/src/sage/matrix/matrix_sparse.pyx
@@ -16,7 +16,7 @@ cimport cython
cimport sage.matrix.matrix as matrix
cimport sage.matrix.matrix0 as matrix0
from sage.structure.element cimport Element, RingElement, ModuleElement, Vector
-from sage.structure.sage_object cimport richcmp
+from sage.structure.richcmp cimport richcmp
from sage.rings.ring import is_Ring
from sage.misc.misc import verbose
diff --git a/src/sage/misc/constant_function.pyx b/src/sage/misc/constant_function.pyx
index d4129f2..09a1f4c 100644
--- a/src/sage/misc/constant_function.pyx
+++ b/src/sage/misc/constant_function.pyx
@@ -1,13 +1,19 @@
r"""
Constant functions
"""
+
#*****************************************************************************
-# Copyright (C) 2009 Nicolas M. Thiery <nthiery at users.sf.net>
+# Copyright (C) 2009 Nicolas M. Thiery <nthiery at users.sf.net>
#
-# Distributed under the terms of the GNU General Public License (GPL)
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
# http://www.gnu.org/licenses/
-#******************************************************************************
-from sage.structure.sage_object cimport SageObject, richcmp
+#*****************************************************************************
+
+from sage.structure.richcmp cimport richcmp
+from sage.structure.sage_object cimport SageObject
cdef class ConstantFunction(SageObject):
diff --git a/src/sage/modular/arithgroup/arithgroup_element.pyx b/src/sage/modular/arithgroup/arithgroup_element.pyx
index 7cae7d2..dd80644 100644
--- a/src/sage/modular/arithgroup/arithgroup_element.pyx
+++ b/src/sage/modular/arithgroup/arithgroup_element.pyx
@@ -16,7 +16,7 @@ Elements of Arithmetic Subgroups
from __future__ import absolute_import
from sage.structure.element cimport MultiplicativeGroupElement, MonoidElement, Element
-from sage.structure.sage_object cimport richcmp
+from sage.structure.richcmp cimport richcmp
from sage.rings.all import ZZ
from sage.modular.cusps import Cusp
diff --git a/src/sage/modular/arithgroup/farey_symbol.pyx b/src/sage/modular/arithgroup/farey_symbol.pyx
index 7df08d4..cf946ec 100644
--- a/src/sage/modular/arithgroup/farey_symbol.pyx
+++ b/src/sage/modular/arithgroup/farey_symbol.pyx
@@ -47,7 +47,7 @@ from sage.plot.all import hyperbolic_arc, hyperbolic_triangle, text
from sage.misc.latex import latex
from sage.misc.lazy_attribute import lazy_attribute
from sage.misc.cachefunc import cached_method
-from sage.structure.sage_object cimport richcmp_not_equal
+from sage.structure.richcmp cimport richcmp_not_equal
cdef extern from "sage/modular/arithgroup/sl2z.hpp":
diff --git a/src/sage/modular/btquotients/pautomorphicform.py b/src/sage/modular/btquotients/pautomorphicform.py
index a30256a..d5ceabd 100644
--- a/src/sage/modular/btquotients/pautomorphicform.py
+++ b/src/sage/modular/btquotients/pautomorphicform.py
@@ -51,7 +51,7 @@ from builtins import zip
from sage.modular.btquotients.btquotient import DoubleCosetReduction
from sage.structure.unique_representation import UniqueRepresentation
-from sage.structure.sage_object import op_EQ, op_NE
+from sage.structure.richcmp import op_EQ, op_NE
from sage.matrix.matrix_space import MatrixSpace
from sage.structure.element import ModuleElement
diff --git a/src/sage/modular/cusps.py b/src/sage/modular/cusps.py
index c724394..405608a 100644
--- a/src/sage/modular/cusps.py
+++ b/src/sage/modular/cusps.py
@@ -35,7 +35,7 @@ from sage.rings.infinity import is_Infinite, Infinity
from sage.structure.parent_base import ParentWithBase
from sage.structure.element import Element, is_InfinityElement
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
from sage.modular.modsym.p1list import lift_to_sl2z_llong
from sage.matrix.matrix import is_Matrix
diff --git a/src/sage/modular/cusps_nf.py b/src/sage/modular/cusps_nf.py
index 31d6882..e9440aa 100644
--- a/src/sage/modular/cusps_nf.py
+++ b/src/sage/modular/cusps_nf.py
@@ -86,7 +86,7 @@ from six import integer_types
from sage.structure.parent_base import ParentWithBase
from sage.structure.element import Element, is_InfinityElement
-from sage.structure.sage_object import richcmp, rich_to_bool
+from sage.structure.richcmp import richcmp, rich_to_bool
from sage.misc.cachefunc import cached_method
from sage.misc.superseded import deprecated_function_alias
diff --git a/src/sage/modular/dirichlet.py b/src/sage/modular/dirichlet.py
index f8669f4..682a303 100644
--- a/src/sage/modular/dirichlet.py
+++ b/src/sage/modular/dirichlet.py
@@ -80,7 +80,7 @@ from sage.structure.gens_py import multiplicative_iterator
from sage.structure.parent import Parent
from sage.structure.sequence import Sequence
from sage.structure.factory import UniqueFactory
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
from sage.arith.all import (binomial, bernoulli, kronecker, factor, gcd,
lcm, fundamental_discriminant, euler_phi, factorial, valuation)
diff --git a/src/sage/modular/hecke/element.py b/src/sage/modular/hecke/element.py
index 4d7aa43..f8af57a 100644
--- a/src/sage/modular/hecke/element.py
+++ b/src/sage/modular/hecke/element.py
@@ -23,7 +23,7 @@ AUTHORS:
# http://www.gnu.org/licenses/
#*****************************************************************************
-from sage.structure.sage_object import richcmp, op_NE
+from sage.structure.richcmp import richcmp, op_NE
from sage.structure.element import ModuleElement
def is_HeckeModuleElement(x):
diff --git a/src/sage/modular/modform_hecketriangle/graded_ring_element.py b/src/sage/modular/modform_hecketriangle/graded_ring_element.py
index b90249e..fbf1d7a 100644
--- a/src/sage/modular/modform_hecketriangle/graded_ring_element.py
+++ b/src/sage/modular/modform_hecketriangle/graded_ring_element.py
@@ -24,7 +24,7 @@ from sage.rings.number_field.number_field import QuadraticField
from sage.symbolic.all import pi
from sage.structure.parent_gens import localvars
-from sage.structure.sage_object import op_NE, op_EQ
+from sage.structure.richcmp import op_NE, op_EQ
from sage.structure.element import CommutativeAlgebraElement
from sage.structure.unique_representation import UniqueRepresentation
diff --git a/src/sage/modular/modsym/manin_symbol.pyx b/src/sage/modular/modsym/manin_symbol.pyx
index be67254..d9a7c8b 100644
--- a/src/sage/modular/modsym/manin_symbol.pyx
+++ b/src/sage/modular/modsym/manin_symbol.pyx
@@ -27,7 +27,7 @@ from sage.rings.all import Infinity, ZZ
from sage.rings.integer cimport Integer
from sage.structure.element cimport Element
from sage.structure.sage_object import register_unpickle_override
-from sage.structure.sage_object cimport richcmp_not_equal, richcmp
+from sage.structure.richcmp cimport richcmp_not_equal, richcmp
def is_ManinSymbol(x):
diff --git a/src/sage/modular/pollack_stevens/dist.pyx b/src/sage/modular/pollack_stevens/dist.pyx
index 65c58d1..c8f72a6 100644
--- a/src/sage/modular/pollack_stevens/dist.pyx
+++ b/src/sage/modular/pollack_stevens/dist.pyx
@@ -28,8 +28,8 @@ REFERENCES:
# http://www.gnu.org/licenses/
#*****************************************************************************
from __future__ import print_function
-from sage.structure.sage_object import SageObject
-from sage.structure.sage_object cimport richcmp_not_equal, rich_to_bool
+from sage.structure.sage_object cimport SageObject
+from sage.structure.richcmp cimport richcmp_not_equal, rich_to_bool
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.rings.power_series_ring import PowerSeriesRing
diff --git a/src/sage/modular/pollack_stevens/modsym.py b/src/sage/modular/pollack_stevens/modsym.py
index 7c0ea81..259af46 100644
--- a/src/sage/modular/pollack_stevens/modsym.py
+++ b/src/sage/modular/pollack_stevens/modsym.py
@@ -40,7 +40,7 @@ from __future__ import print_function
from __future__ import absolute_import
import operator
from sage.structure.element import ModuleElement
-from sage.structure.sage_object import op_EQ, op_NE
+from sage.structure.richcmp import op_EQ, op_NE
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.misc.cachefunc import cached_method
diff --git a/src/sage/modular/pollack_stevens/sigma0.py b/src/sage/modular/pollack_stevens/sigma0.py
index ea74d2b..e2a4f65 100644
--- a/src/sage/modular/pollack_stevens/sigma0.py
+++ b/src/sage/modular/pollack_stevens/sigma0.py
@@ -51,7 +51,7 @@ from sage.matrix.matrix_space import MatrixSpace
from sage.misc.abstract_method import abstract_method
from sage.structure.factory import UniqueFactory
from sage.structure.element import MonoidElement
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
from sage.categories.monoids import Monoids
from sage.categories.morphism import Morphism
from sage.structure.parent import Parent
diff --git a/src/sage/modules/fg_pid/fgp_element.py b/src/sage/modules/fg_pid/fgp_element.py
index 1fd2a39..4dd63a9 100644
--- a/src/sage/modules/fg_pid/fgp_element.py
+++ b/src/sage/modules/fg_pid/fgp_element.py
@@ -16,7 +16,7 @@ AUTHOR:
#*****************************************************************************
from sage.structure.element import ModuleElement
-from sage.structure.sage_object import richcmp
+from sage.structure.richcmp import richcmp
# This adds extra maybe-not-necessary checks in the code, but could
# slow things down. It can impact what happens in more than just this
diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
index 91873f2..a244724 100644
--- a/