File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -896,10 +896,7 @@ def _coerce_base_ring(self, other):
896
896
if not other_ring .is_exact ():
897
897
other_ring = RDF # the only supported floating-point numbers for now
898
898
899
- cm_map , cm_ring = get_coercion_model ().analyse (self .base_ring (), other_ring )
900
- if cm_ring is None :
901
- raise TypeError (f'Could not coerce type { other } into ZZ, QQ, or RDF.' )
902
- return cm_ring
899
+ return get_coercion_model ().common_parent (self .base_ring (), other_ring )
903
900
904
901
def _coerce_map_from_ (self , X ):
905
902
r"""
Original file line number Diff line number Diff line change @@ -808,6 +808,9 @@ cdef class CoercionModel:
808
808
elements or parents). If the parent of the result can be determined
809
809
then it will be returned.
810
810
811
+ For programmatic usages, use :meth:`canonical_coercion` and
812
+ :meth:`common_parent` instead.
813
+
811
814
EXAMPLES::
812
815
813
816
sage: cm = sage.structure.element.get_coercion_model()
@@ -938,6 +941,9 @@ cdef class CoercionModel:
938
941
the actual morphism and action objects (rather than their string
939
942
representations), then this is the function to use.
940
943
944
+ For programmatic usages, use :meth:`canonical_coercion` and
945
+ :meth:`common_parent` instead.
946
+
941
947
EXAMPLES::
942
948
943
949
sage: cm = sage.structure.element.get_coercion_model()
You can’t perform that action at this time.
0 commit comments