On Fri, May 01, 2009 at 12:31:40PM -0700, William Stein wrote:
> 
> On Fri, May 1, 2009 at 12:16 PM, Robert Bradshaw
> <rober...@math.washington.edu> wrote:
> >
> > On May 1, 2009, at 8:15 AM, kcrisman wrote:
> >
> >>> 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?
> >>
> >> As for throwing an error, probably that should be done Sage-wide for
> >> things that don't make sense, not piecemeal.  At least I don't feel
> >> comfortable opening that can of worms!
> >
> > Yep, this was opened a while back, and it turned into one of the
> > longest treads ever... I would still like to see conclusion on that.
> 
> Despite being a huge thread, the resolution is really easy.  I think
> we should do the following: "The ordering comparison operators (<, <=,
> >=, >) should raise a TypeError exception when the operands don’t have
> a meaningful natural ordering. Thus, expressions like 1 < '', 0 > None
> or len <= len will no longer be valid. A corollary is that sorting a
> heterogeneous list no longer makes sense – all the elements must be
> comparable to each other. Note that this does not apply to the == and
> != operators: objects of different incomparable types will always
> compare unequal to each other."

+1

What's not resolved is how much the system should try to be clever
when comparing, e.g., and element of QQ[sqrt(2)] and of QQ[sqrt(3)].

> The question is now how to do this.  Little by little, or all at
> once.  I prefer little by little whenever possible, so is that
> possible here?

If this can help measure the progress, I can add a systematic test in
the Sets() category, so that for P a parent, P.check() will check that
P.an_element() < None actually raises an error.

Cheers,
                                Nicolas
--
Nicolas M. Thiéry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

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