Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed10.multikabel.net!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'underlying': 0.09; 'am,': 0.12; '16,': 0.15; 'mon,': 0.15; 'enigma': 0.16; 'entries.': 0.16; 'kern': 0.16; 'seperate': 0.16; 'sortable': 0.16; 'wrote:': 0.16; 'jan': 0.19; 'header:In-Reply-To:1': 0.22; 'interface': 0.23; 'translated': 0.23; 'pm,': 0.26; 'code,': 0.27; 'filter': 0.28; 'lists': 0.28; 'interpret': 0.28; 'chris': 0.30; 'pure': 0.32; 'suggested': 0.32; 'list': 0.32; "can't": 0.32; 'sort': 0.32; 'header:User-Agent:1': 0.33; 'to:addr:python-list': 0.33; 'all.': 0.34; 'header:X-Complaints-To:1': 0.34; 'probably': 0.35; 'lists,': 0.35; 'convenient': 0.36; 'two': 0.37; 'but': 0.37; 'received:org': 0.37; 'using': 0.37; 'describe': 0.38; 'subject:: ': 0.39; 'to:addr:python.org': 0.40; 'most': 0.60; 'world': 0.62; 'received:86': 0.63; 'our': 0.64; 'believe': 0.65; 'want,': 0.71; '(one': 0.73; '10:57': 0.84; 'eco': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Robert Kern Subject: Re: NaN, Null, and Sorting Date: Mon, 16 Jan 2012 11:07:26 +0000 References: <67bd5e6b-a332-4d13-aad3-8de88b218ac5@z19g2000vbe.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host86-147-14-7.range86-147.btcentralplus.com User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1326712065 news.xs4all.nl 6904 [2001:888:2000:d::a6]:60570 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19038 On 1/16/12 10:57 AM, Chris Angelico wrote: > On Mon, Jan 16, 2012 at 9:22 PM, Eelco wrote: >> What you want, conceptually, is a >> sorted list of the sortable entries, and a seperate list of the >> unsorted entries. Translated into code, the most pure solution would >> be to filter out the nanas/nulls in their own list first, and then >> sort the rest. If the interface demands it, you can concatenate the >> lists afterwards, but probably it is most convenient to keep them in >> seperate lists. > > So... you split it into two lists, sort the two lists (one of which > can't be sorted), and then concatenate them. Sounds like the quicksort > algorithm. Not at all. The "split it into two lists" steps are entirely different in what Eelco suggested and quicksort. It's misleading to attempt to describe both using the same words. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco