Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.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.035 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'subject:would': 0.07; 'cc:addr:python-list': 0.11; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hmm.': 0.16; 'none.': 0.16; 'sorts': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'looks': 0.24; 'cc:2**0': 0.24; 'sort': 0.25; 'header:In-Reply-To:1': 0.27; 'list:': 0.30; 'returned': 0.30; 'message-id:@mail.gmail.com': 0.30; 'changed.': 0.31; 'figure': 0.32; 'fri,': 0.33; "i'd": 0.34; 'received:google.com': 0.35; 'subject:?': 0.36; 'list': 0.37; 'jason': 0.38; 'list,': 0.38; 'pm,': 0.38; 'rather': 0.38; 'itself': 0.39; '20,': 0.68; '2015': 0.84; 'subject:you': 0.87; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=Pl6Rx2/kh7ei5bJLIK9cqR0rBVNcfaR2xoglEBI3L+w=; b=Q3TX12mottiRol2jQ+LnMnX3P81VbgQrXb+3jIH82fiUO03IkOK6ePEoC2I1pt8qxW AiU2st7ujFb6GyEOSL1LELVghsRzQprqzeTZ/GdykcmgQQVcvYAQ+3BB3Nni3ISK7W08 HQ2U7JnEPemSQHk/bk3+6i79ESje3Jt6AgZFMhEkQJD3XqhzkSY/Y9ZuTULY7eQgJKsi YqqSK/rGYabFROTerR8uYO26ZfHE0hkNNeAJohvZChJoSHzMwB12vqkafoSJVZZbCweV D56TtRKBQ9G3Vy0+6EOWKSUPL1NCSEiV4a3s4c7NKwKS4meXf8yJgGOqdTv0u1gchuAN xiLw== MIME-Version: 1.0 X-Received: by 10.107.128.219 with SMTP id k88mr9997784ioi.27.1424411867273; Thu, 19 Feb 2015 21:57:47 -0800 (PST) In-Reply-To: References: Date: Fri, 20 Feb 2015 16:57:47 +1100 Subject: Re: What behavior would you expect? From: Chris Angelico Cc: python-list Content-Type: text/plain; charset=UTF-8 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424411875 news.xs4all.nl 2878 [2001:888:2000:d::a6]:58553 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:85951 On Fri, Feb 20, 2015 at 4:51 PM, 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? Check its docs: it sorts the list in place. So you return the list, after you sort it. It's like appending to a list: None is returned and the list itself is changed. ChrisA