You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/sage/rings/morphism.pyx
-137Lines changed: 0 additions & 137 deletions
Original file line number
Diff line number
Diff line change
@@ -413,29 +413,6 @@ from sage.structure.richcmp cimport (richcmp, rich_to_bool)
413
413
from sage.misc.cachefunc import cached_method
414
414
415
415
416
-
defis_RingHomomorphism(phi):
417
-
"""
418
-
Return ``True`` if ``phi`` is of type :class:`RingHomomorphism`.
419
-
420
-
EXAMPLES::
421
-
422
-
sage: f = Zmod(8).cover()
423
-
sage: sage.rings.morphism.is_RingHomomorphism(f)
424
-
doctest:warning
425
-
...
426
-
DeprecationWarning: is_RingHomomorphism() should not be used anymore. Check whether the category_for() your morphism is a subcategory of Rings() instead.
427
-
See https://github.com/sagemath/sage/issues/23204 for details.
sage.misc.superseded.deprecation(23204, "is_RingHomomorphism() should not be used anymore. Check whether the category_for() your morphism is a subcategory of Rings() instead.")
433
-
# We use the category framework to determine whether something is a ring homomorphism.
434
-
from sage.categories.map import Map
435
-
from sage.categories.rings import Rings
436
-
returnisinstance(phi, Map) and phi.category_for().is_subcategory(Rings())
437
-
438
-
439
416
cdef class RingMap(Morphism):
440
417
"""
441
418
Set-theoretic map between rings.
@@ -1682,120 +1659,6 @@ cdef class RingHomomorphism(RingMap):
1682
1659
returnself.is_injective() andself.is_surjective()
1683
1660
1684
1661
1685
-
cdef class RingHomomorphism_coercion(RingHomomorphism):
1686
-
r"""
1687
-
A ring homomorphism that is a coercion.
1688
-
1689
-
.. WARNING::
1690
-
1691
-
This class is obsolete. Set the category of your morphism to a
1692
-
subcategory of ``Rings`` instead.
1693
-
1694
-
TESTS:
1695
-
1696
-
sage: from sage.rings.morphism import RingHomomorphism_coercion
1697
-
sage: parent = Hom(ZZ,ZZ)
1698
-
sage: f = parent.__make_element_class__(RingHomomorphism_coercion)(parent)
1699
-
doctest:warning
1700
-
...
1701
-
DeprecationWarning: Set the category of your morphism to a subcategory of Rings instead.
1702
-
See https://github.com/sagemath/sage/issues/23204 for details.
1703
-
sage: TestSuite(f).run()
1704
-
1705
-
"""
1706
-
def__init__(self, parent, check=True):
1707
-
r"""
1708
-
TESTS:
1709
-
1710
-
sage: from sage.rings.morphism import RingHomomorphism_coercion
1711
-
sage: parent = Hom(ZZ,ZZ)
1712
-
sage: f = parent.__make_element_class__(RingHomomorphism_coercion)(parent)
1713
-
doctest:warning
1714
-
...
1715
-
DeprecationWarning: Set the category of your morphism to a subcategory of Rings instead.
1716
-
See https://github.com/sagemath/sage/issues/23204 for details.
1717
-
sage: isinstance(f, RingHomomorphism_coercion)
1718
-
True
1719
-
1720
-
"""
1721
-
sage.misc.superseded.deprecation(23204, "Set the category of your morphism to a subcategory of Rings instead.")
1722
-
1723
-
RingHomomorphism.__init__(self, parent)
1724
-
# putting in check allows us to define subclasses of RingHomomorphism_coercion that implement _coerce_map_from
1725
-
if check andnotself.codomain().has_coerce_map_from(self.domain()):
1726
-
raiseTypeError("Natural coercion morphism from %s to %s not defined."%(self.domain(), self.codomain()))
1727
-
1728
-
def_repr_type(self):
1729
-
"""
1730
-
Used internally when printing this.
1731
-
1732
-
EXAMPLES::
1733
-
1734
-
sage: from sage.rings.morphism import RingHomomorphism_coercion
1735
-
sage: parent = Hom(ZZ,ZZ)
1736
-
sage: f = parent.__make_element_class__(RingHomomorphism_coercion)(parent)
1737
-
sage: f._repr_type()
1738
-
'Ring Coercion'
1739
-
1740
-
"""
1741
-
return"Ring Coercion"
1742
-
1743
-
cpdef _richcmp_(self, other, int op):
1744
-
"""
1745
-
Compare a ring coercion morphism ``self`` to ``other``.
1746
-
1747
-
Ring coercion morphisms never compare equal to any other data type. If
1748
-
other is a ring coercion morphism, the parents of ``self`` and
1749
-
``other`` are compared.
1750
-
1751
-
EXAMPLES::
1752
-
1753
-
sage: from sage.rings.morphism import RingHomomorphism_coercion
1754
-
sage: parent = Hom(ZZ,ZZ)
1755
-
sage: f = parent.__make_element_class__(RingHomomorphism_coercion)(parent)
0 commit comments