Incomparable abominations (was: python-dev Summary)

Jeremy Fincher tweedgeezer at hotmail.com
Fri Mar 21 00:58:58 EST 2003


"John Roth" <johnroth at ameritech.net> wrote in message news:<v7krnnm82qdi98 at news.supernews.com>...
> "Jeremy Fincher" <tweedgeezer at hotmail.com> wrote in message
> news:698f09f8.0303201041.6b69619d at posting.google.com...
> > If something like this was added, so there was a total ordering on
> > Python objects during sorts, I'd be completely happy with the
> > comparison operators </>/<=/>= being changed to only work between
> > consistent types.  In fact, I'd prefer it that way.
> >
> > Of course, == and != would still work between inconsistent types.
> 
> I think that's probably the way is *should* have been from the
> beginning. However, I'd be against changing it at this point; it would
> break programs. Save the change for Python 3000.

If the sort() method on lists was changed to use this total ordering
on Python objects (using before()), then changing the relational
operators to raise exceptions on type-invalid code wouldn't break any
of *my* code, so I'd be fine with the change :)

(And what code it did break, mine or not, would almost certainly be
either a bug or a place that would need to use before() instead of <;
I can't imagine the latter case occuring all that often.)

Jeremy




More information about the Python-list mailing list