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

[Python-Dev] decorate-sort-undecorate

[Python-Dev] decorate-sort-undecorate [Python-Dev] decorate-sort-undecorateGuido van Rossum guido at python.org
Wed Oct 15 12:02:12 EDT 2003
> > What about the situation where you want the list sorted in reverse order? 
> > If you simply sort and then reverse the list you've broken the stability. 
> 
> Yes, that's the same thing Alex Martelli brought up.  You could also
> supply a cmp function, as Geoffrey Talvola suggested (though this will
> make the comparisons more costly).

Oops.  I misremembered Geoffrey's suggestion; he suggested two sorts
with a reverse() call in between.  I think that would have the same
problem.

--Guido van Rossum (home page: http://www.python.org/~guido/)

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