Thierry wrote: > My favourite is "in RealField(2)" just in case you fall into something > with smaller precision. But if you prefer to work with coercion, then > you should first remove SR(2.3) and 2*pi from your first list, and you > could do something like: > > is_real = lambda self: > get_coercion_model().common_parent(self.parent(),RealField(2)) is > RealField(2)
In this case, I think that RealField(mpfr_prec_min()).has_coerce_map_from(parent(foo)) should be enough. (And I think that's the most reasonable thing to do: in doubt, prefer coercion over conversion!) -- Marc -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.