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-October/038684.html below:

[Python-Dev] decorate-sort-undecorate

[Python-Dev] decorate-sort-undecorate [Python-Dev] decorate-sort-undecorateAlex Martelli aleaxit at yahoo.com
Tue Oct 14 04:01:10 EDT 2003
On Tuesday 14 October 2003 05:31 am, Guido van Rossum wrote:
   ...
> After reading this exchange, I'm not sure I agree with Tim about the
> importance of avoiding to compare the full records.  Certainly the
> *cost* of that comparison doesn't bother me: I expect it's usually
> going to be a tuple or list of simple types like ints and strings, and
> comparing those is pretty efficient.

I have and have seen many use cases where the things being sorted
are dictionaries (comparisons can be costlier) or instances (they can
be non-comparable).

I agree that the "stable" nature of sorting is not all that important in
our context.  But avoiding whole-record comparison in the general
case seems important enough to me that I'd accept any arbitrary
non-comparing behavior (e.g. making the id of the thing being sorted
the secondary key!-) rather than default to whole-record compares.


Alex


More information about the Python-Dev mailing list

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