Skip to content

Commit a4a4fd2

Browse files
committed
Remove programmatic usage of analyse()
1 parent 9352a32 commit a4a4fd2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/sage/geometry/polyhedron/parent.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -896,10 +896,7 @@ def _coerce_base_ring(self, other):
896896
if not other_ring.is_exact():
897897
other_ring = RDF # the only supported floating-point numbers for now
898898

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)
903900

904901
def _coerce_map_from_(self, X):
905902
r"""

src/sage/structure/coerce.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,6 +808,9 @@ cdef class CoercionModel:
808808
elements or parents). If the parent of the result can be determined
809809
then it will be returned.
810810
811+
For programmatic usages, use :meth:`canonical_coercion` and
812+
:meth:`common_parent` instead.
813+
811814
EXAMPLES::
812815
813816
sage: cm = sage.structure.element.get_coercion_model()
@@ -938,6 +941,9 @@ cdef class CoercionModel:
938941
the actual morphism and action objects (rather than their string
939942
representations), then this is the function to use.
940943
944+
For programmatic usages, use :meth:`canonical_coercion` and
945+
:meth:`common_parent` instead.
946+
941947
EXAMPLES::
942948
943949
sage: cm = sage.structure.element.get_coercion_model()

0 commit comments

Comments
 (0)