Hi, On Mon, Sep 19, 2016 at 06:54:29PM +0200, Jeroen Demeyer wrote: > On 2016-09-19 18:37, Travis Scrimshaw wrote: > >The closest I can get is "foo in RR". This fails for CC(2.3, 0), but I > >consider that to be a real number. > > I would say it's a complex number which happens to have a real value. But it > is not a real number. It's the difference between *coercion* and > *conversion*.
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) Ciao, Thierry > But anyway, your answer might be good enough for my use case. > > -- > 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. -- 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.