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

[Python-Dev] Re: inline sort option

[Python-Dev] Re: inline sort option [Python-Dev] Re: inline sort optionDavid Eppstein eppstein at ics.uci.edu
Thu Oct 16 14:25:13 EDT 2003
In article <004f01c3940d$ea1c1320$e841fea9 at oemcomputer>,
 "Raymond Hettinger" <python at rcn.com> wrote:

> Are you proposing something like:
> 
>     print mylist.sort(inplace=False)  # prints a new, sorted list while
>                                       # leaving the original list intact

What's wrong with writing your own three-line function

def sort(L):
    copy = list(L)
    copy.sort()
    return copy

then you can do print sort(mylist) etc to your heart's content...

-- 
David Eppstein                      http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science


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