On Thu, Oct 15, 2009 at 6:22 PM, Daniel Ribeiro <dan...@gmail.com> wrote:
>
> Just found out: 'div' became "__floordiv__" which is invoked also
> as //
>
> (from http://docs.python.org/library/operator.html)
>
> Which kinda brings the question: why doesn't "|", also known as
> "__or__" is not implemented by polynomials, as a synomim for divides?
>
> Reads equally well:
> Given:
> P.<x> = GF(7)[]
>
>
> (x^2 + 2*x + 2).divides(x^9 + 5*x)
> (x^2 + 2*x + 2) | (x^9 + 5*x)
>
> Just a suggestion.

One reason is that if one did the above, then it would be natural to
do the same for other types, e.g., integers.  It would then be
confusing if when I do

sage: 5 | 3
7

I instead got:

sage: 5 | 3
False

This would be especially confusing, because no matter what we will have

sage: int(5) | int(3)
7

since one can't overload arithmetic operators for builtin types.

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to