mabshoff wrote:
> 
> 
> On May 1, 7:38 am, kcrisman <kcris...@gmail.com> wrote:
>>>>     sage: P>x^2+x
>>>> Expected:
>>>>     True
>>>> Got:
>>>>     False
>> Yes, I just added that test to show that Primes() has comparison.  I
>> was a little surprised to see the result, but it passed testing, so...
>>
>> If someone posts a ticket with a suggested fix that makes Primes()
>> greater than everything, I can try to implement it - I  but for now I
>> just wanted to make sure it was clear Primes() did compare to weird
>> things and not throw an error.
> 
> Well, what I wrote was nonsense. __cmp__ always returns -1 unless both
> are Primes(), i.e what is greater depends on what is left and right
> respectively. I don't care too much about that now, but if someone has
> a better suggestion I am interested in hearing it.


In the future of python, things that don't have a sensible order throw a 
TypeError when comparing:

http://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons

Why don't we just throw an error?

Jason

-- 
Jason Grout


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

Reply via email to