Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 9a9e437

Browse files
Julian Rüthsaraedum
Julian Rüth
authored andcommitted
Print default "coerce" maps as "Coercion"
1 parent 7dac7e2 commit 9a9e437

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/sage/structure/coerce_maps.pyx

+13-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,19 @@ cdef class DefaultConvertMap(Map):
5858
self._force_use = force_use
5959
if (<Parent>codomain)._element_constructor is None:
6060
raise RuntimeError("BUG in coercion model, no element constructor for {}".format(type(codomain)))
61-
self._repr_type_str = "Coercion" if self._is_coercion else "Conversion"
61+
62+
def _repr_type(self):
63+
r"""
64+
Return a printable type for this morphism.
65+
66+
EXAMPLES::
67+
68+
sage: f = GF(11).convert_map_from(GF(7))
69+
sage: f._repr_type()
70+
'Conversion'
71+
72+
"""
73+
return self._repr_type_str or ("Coercion" if self._is_coercion else "Conversion")
6274

6375
cdef dict _extra_slots(self, dict _slots):
6476
_slots['_force_use'] = self._force_use

0 commit comments

Comments
 (0)