Incomparable abominations (was: python-dev Summary)

Jp Calderone exarkun at intarweb.us
Fri Mar 21 13:23:37 EST 2003


On Fri, Mar 21, 2003 at 08:29:34AM -0500, John Roth wrote:
> 
> "Jeremy Fincher" <tweedgeezer at hotmail.com> wrote in message
> news:698f09f8.0303202158.511534e8 at posting.google.com...
> > "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.)
> 
> But that's not the issue. Suggested changes to Python won't happen if
> there's any likelihood of breaking people's code. Incompatible changes
> need a lot of justification and quite a bit of work to show that the error
> cases are unlikely. Assertions don't do it; actual surveys of working code
> are needed.

  Nah.  All that's needed is a BDFL pronouncement.  PEP 238, for example.

> 
> Even then it would have to be transitioned in over several releases, with
> warning messages for illegal usage.

  That much is certain.

  Jp

-- 
Examinations are formidable even to the best prepared, for
even the greatest fool may ask more the the wisest man can answer.
                -- C.C. Colton
-- 
 up 1 day, 13:58, 2 users, load average: 0.18, 0.34, 0.36





More information about the Python-list mailing list