From 8c0efe704d0dee6efb6267b45150fd0bd7d6cea0 Mon Sep 17 00:00:00 2001 From: Xavier Caruso Date: Mon, 6 Jul 2020 18:14:17 +0200 Subject: [PATCH] add a doctest --- src/sage/categories/rings.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sage/categories/rings.py b/src/sage/categories/rings.py index 388db73e658..78ccb6ec0b1 100644 --- a/src/sage/categories/rings.py +++ b/src/sage/categories/rings.py @@ -231,6 +231,14 @@ def extend_to_fraction_field(self): Traceback (most recent call last): ... ValueError: the morphism is not injective + + TESTS:: + + sage: A. = RR[] + sage: phi = A.hom([x+1]) + sage: phi.extend_to_fraction_field() + Ring endomorphism of Fraction Field of Univariate Polynomial Ring in x over Real Field with 53 bits of precision + Defn: x |--> x + 1.00000000000000 """ from sage.rings.morphism import RingHomomorphism_from_fraction_field if self.domain().is_field() and self.codomain().is_field():