Compare:
sage: A.<a> = ZZ[]
sage: B.<b> = ZZ[]
sage: phi = A.hom([b])
sage: phi.register_as_coercion()
with:
sage: A.<a> = ZZ[]
sage: B.<b> = ZZ[]
sage: B.has_coerce_map_from(A)
False
sage: phi = A.hom([b])
sage: phi.register_as_coercion()
Traceback (most recent call last):
...
AssertionError: coercion from Univariate Polynomial Ring in a over Integer Ring to Univariate Polynomial Ring in b over Integer Ring already registered or discovered
CC: @tscrim
Component: coercion
Author: Xavier Caruso
Branch/Commit: 1b1467b
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/29517