Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.086 X-Spam-Evidence: '*H*': 0.83; '*S*': 0.00; 'subject:would': 0.07; 'true)': 0.09; 'hmm.': 0.16; 'none.': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'header:User-Agent:1': 0.23; 'looks': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "i'm": 0.30; 'figure': 0.32; 'guess': 0.33; "i'd": 0.34; 'really': 0.36; 'returning': 0.36; 'subject:?': 0.36; 'jason': 0.38; 'to:addr:python-list': 0.38; 'list,': 0.38; 'rather': 0.38; 'to:addr:python.org': 0.39; "you'll": 0.62; 'charset:windows-1252': 0.65; 'received:74.208': 0.68; 'reverse': 0.68; 'subject:you': 0.87 Date: Fri, 20 Feb 2015 08:07:29 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: What behavior would you expect? References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:t8+svBcJfaumobv/IgN9PvZnp9rXJOWYF2yTmpPmfVj 1W4RtLk1JFHVxjjfNKB9zdNl2WdDHXMr4qWRecbMSdchASIPWS PZ02Bw28GaW00n4qklqdpBk4xXahbwMpDnwEKiLlse01aTQrPa MOh2GtasTSa44+yBgnPjpRJwHC3/d34rp7dVYjbW75fHwaGGpa beH3W04rc3fRGeWRwBsZq/sPndrO+kgYcAw1UspBFVI0ZfS17X 2SmAm3gxJJPYcH+OBbIelSgazTZyE/SBSe6pJxBe2QCX+l1JrZ UymUgw6/eyaInoaLQI/AVlH9G/q11QqKY7QgZRmY+1N6e2lXQ= = X-UI-Out-Filterresults: notjunk:1; X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424437670 news.xs4all.nl 2925 [2001:888:2000:d::a6]:55764 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:85967 On 02/20/2015 12:51 AM, Jason Friedman wrote: >> >> I'd still advise using my_list.sort() rather than sorted(), as you >> don't need to retain the original. >> >> > Hmm. > > Trying to figure out what that looks like. > If I understand correctly, list.sort() returns None. > What would I return to the caller? > return_list = .... return_list.sort(key=..., reverse = True) return return_list > > Oops, guess I'm not really returning a list, I'm returning an iterator. Now you'll be returning a list, I believe. -- DaveA