A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-March/034070.html below:

[Python-Dev] Re: Re: lists v. tuples

[Python-Dev] Re: Re: lists v. tuplesTerry Reedy tjreedy@udel.edu
Sat, 15 Mar 2003 12:54:05 -0500
"Guido van Rossum" <guido@python.org> wrote in message
news:200303151236.h2FCaJP06038@pcp02138704pcs.reston01.va.comcast.net.
..
> But the order isn't meaningful.
....
> If I had to do it over again, I'd only implement == and != for
objects
> of vastly differing types, and limit <, <=, >, >= to objects that
are
> meaningfully comparable.

For user-defined types/classes, I presume that this would still mean
deferring to the appropriate magic method (__cmp__ or __ge__?) to
define 'meaningful'.

> I'd like to to this in Python 3.0, but that probably means we'd have
> to start deprecating default comparisons except (in)equality in
Python
> 2.4.

+1, I think.

Based on reading cl.py, the validity of nonsense comparisons is one of
the more surprising 'features' of Python for beginners -- who
reasonably expect a TypeError or ValueError.  Once they get past that,
they are then surprised by the unstability across versions.  Given
that universal sorting of hetero-lists is now broken, I think it would
be better to do away with it cleanly.  It is seldom needed and would
still be available with a user-defined sorting function (which
requires some thought as to what is really wanted).  A Python version
of the present algorithm could be included (in Tools/xx perhaps) for
anyone who actually needs it.

Terry J. Reedy






RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4