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

copysort patch, was RE: [Python-Dev] inline sort option

copysort patch, was RE: [Python-Dev] inline sort option copysort patch, was RE: [Python-Dev] inline sort optionMark Russell marktrussell at btopenworld.com
Mon Oct 20 17:11:02 EDT 2003
On Mon, 2003-10-20 at 19:22, Guido van Rossum wrote:
> But the argument that it wastes a copy still stands (even though
> that's only O(N) vs. O(N log N) for the sort).

That would be irrelevant in most of the cases where I would use it -
typically sorting short lists or dicts where the overhead is
unmeasurable.

> I'm still unclear why this so important to have in the library when
> you can write it yourself in two lines.

For little standalone scripts it gets a bit tedious to write this again
and again.  It doesn't take much code to write dict.fromkeys() manually,
but I'm glad that it's there.  I'd say list.sorted (or whatever it gets
called) has at least as much claim to exist.  

Mark Russell

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