From 523db5d0e2728a5e51daab1a99957921725f6cc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Mon, 20 Oct 2025 15:02:14 +0200 Subject: [PATCH] remove old-style _coerce_impl in abvar/ --- src/sage/modular/abvar/homspace.py | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/sage/modular/abvar/homspace.py b/src/sage/modular/abvar/homspace.py index 16d08c1db2e..4c872debe32 100644 --- a/src/sage/modular/abvar/homspace.py +++ b/src/sage/modular/abvar/homspace.py @@ -155,6 +155,15 @@ sage: T.index_in_saturation() 1 +TESTS:: + + sage: J = J0(37) ; J.Hom(J)(matrix(ZZ,4,[5..20])) + Abelian variety endomorphism of Abelian variety J0(37) of dimension 2 + sage: K = J0(11) * J0(11) ; J.Hom(K)(matrix(ZZ,4,[5..20])) + Abelian variety morphism: + From: Abelian variety J0(37) of dimension 2 + To: Abelian variety J0(11) x J0(11) of dimension 2 + AUTHORS: - William Stein (2007-03) @@ -363,24 +372,6 @@ def __call__(self, M, **kwds): raise TypeError("can only coerce in matrices or morphisms") return self.element_class(self, M, side) - def _coerce_impl(self, x): - """ - Coerce x into self, if possible. - - EXAMPLES:: - - sage: J = J0(37) ; J.Hom(J)._coerce_impl(matrix(ZZ,4,[5..20])) - Abelian variety endomorphism of Abelian variety J0(37) of dimension 2 - sage: K = J0(11) * J0(11) ; J.Hom(K)._coerce_impl(matrix(ZZ,4,[5..20])) - Abelian variety morphism: - From: Abelian variety J0(37) of dimension 2 - To: Abelian variety J0(11) x J0(11) of dimension 2 - """ - if self.matrix_space().has_coerce_map_from(parent(x)): - return self(x) - else: - return HomsetWithBase._coerce_impl(self, x) - def _repr_(self): """ String representation of a modular abelian variety homspace.