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

[Python-Dev] decorate-sort-undecorate

[Python-Dev] decorate-sort-undecorate [Python-Dev] decorate-sort-undecorateJohn Williams jrw at pobox.com
Tue Oct 14 12:09:15 EDT 2003
Guido van Rossum wrote:
> Given that internally we still do a DSU, sorting tuples of (key,
> something), using the id of the record for 'something' is just as
> inefficient as using the original index -- in both cases we'd have to
> allocate len(lst) ints.
> 
> Greg Ewing suggested that the ints shouldn't have to be Python ints.
> While this is true, it would require a much larger overhaul of the
> existing sort code, which assumes the "records" to be sorted are
> pointers to objects.

Why not use a special tuple type for the DSU algorithm that ignores its 
last element when doing a comparison? It eliminates the problem of 
creating a zillion int objects, and <speculation>it would be easy to 
implement.</speculation>

jw


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