On Wednesday, March 28, 2018 at 10:07:17 AM UTC+1, Marc Mezzarobba wrote:
>
> Simon King wrote: 
> > That makes sense to me. 
> > Thus I now think, z.is_prime() should roughly work like this: 
> > def is_prime(self): 
> >     ... 
>
> What about keeping the is_prime() *method* unchanged (except perhaps for 
> adding an optional warning in the default implementation for field 
> elements), and restricting the is_prime() *function* to integers-- 
> perhaps allowing it to automatically convert its argument, after a 
> deprecation period at least? 
>
>
is_prime() should be restricted to rings in which one can have non-trivial 
prime elements, e.g.
it has perfect (and different!!!) meaning in ZZ[i], where 2 is not prime, 
as 2=(1+i)(1-i) or even:

sage: ZZ[I](2).factor()
(-I) * (I + 1)^2

 

> -- 
> 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.

Reply via email to