Hi Erik,

On 2018-03-27, Erik Bray <erik.m.b...@gmail.com> wrote:
> What about adding an optional argument to the is_prime()
> method--something like a.is_prime(as_element_of=ZZ).  It's kind of a
> wordy (though I'm sure there's a more succinct spelling) way to write
> ZZ(a).is_prime() but at least it's still precise about what you're
> asking.

I don't think it'd be a good idea. Reason: What should be the default
value of "as_element_of"? Should it be the parent of "a"? But then, you
immediately have the same problem as we have now, which is the
surprising (to some) fact that (3/1).is_prime() returns False. And the
work-around
  (3/1).is_prime(as_element_of=ZZ)
would be more verbous than
  ZZ(3/1).is_prime()

Best regards,
Simon

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