I agree with both Marc's last 2 suggestions. If the global function is_prime() is called on an integer (even of type Rational) it should do the natural thing. Anything else raises an error with a helpful message that x.is_prime() might be what is wanted.
On Wed, 28 Mar 2018, 12:19 Marc Mezzarobba, <m...@mezzarobba.net> wrote: > Dima Pasechnik wrote: > > is_prime() should be restricted to rings in which one can have > > non-trivial prime elements > > Well, that's what I'm doubting. If the goal is that the global > is_prime() function doesn't do anything surprising for people who would > have integers in mind, then it may be better to restrict it to plain > integers. > > > > > -- > 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. > -- 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.