Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.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.019 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'python': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'skip:k 40': 0.09; 'subject:string': 0.09; '3.2.': 0.16; 'instead:': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'rewriting': 0.16; 'subject:unicode': 0.16; '\xe9crit': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'memory': 0.18; 'example': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.28; '20%': 0.29; '>>>>': 0.29; 'steven': 0.29; 'from:addr:yahoo.co.uk': 0.32; 'getting': 0.33; 'to:addr:python-list': 0.33; 'text': 0.34; 'there': 0.35; 'received:org': 0.36; 'really': 0.36; 'living': 0.36; 'should': 0.36; 'subject:: ': 0.38; 'mark': 0.38; 'fact': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'subject:, ': 0.61; 'subject:...': 0.63; 'email addr:gmail.com': 0.63; 'six': 0.65; 'film': 0.71; 'gain': 0.79; 'otten': 0.84; 'subject:, ...': 0.84; '"that\'s': 0.91; 'comedy': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Flexible string representation, unicode, typography, ... Date: Mon, 03 Sep 2012 07:11:06 +0100 References: <503a8361$0$6574$c3e8da3$5496439d@news.astraweb.com> <2e92da71-fbd2-467f-9088-1c79fa7bcf69@googlegroups.com> <62566024-df1d-4948-a27a-45c7820ddc6c@googlegroups.com> <503f0e45$0$9416$c3e8da3$76491128@news.astraweb.com> <2a12ba52-232a-41b7-a906-1ec379bbddd7@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: host-92-24-209-132.ppp.as43234.net User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:15.0) Gecko/20120824 Thunderbird/15.0 In-Reply-To: X-Antivirus: avast! (VPS 120902-1, 02/09/2012), Outbound message X-Antivirus-Status: Clean 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: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346652593 news.xs4all.nl 6858 [2001:888:2000:d::a6]:34733 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28339 On 03/09/2012 06:39, wxjmfauth@gmail.com wrote: > Le dimanche 2 septembre 2012 14:01:18 UTC+2, Serhiy Storchaka a écrit : >> On 02.09.12 12:52, Peter Otten wrote: >> >>> Ian Kelly wrote: >> >>> >> >>>> Rewriting the example to use locale.strcoll instead: >> >>> >> >>>>>>> sorted(li, key=functools.cmp_to_key(locale.strcoll)) >> >>> >> >>> There is also locale.strxfrm() which you can use directly: >> >>> >> >>> sorted(li, key=locale.strxfrm) >> >> >> >> Hmm, and with locale.strxfrm Python 3.3 20% slower than 3.2. > > With a memory gain = 0 since my text contains non-latin-1 characters! > > jmf > This is getting really funny. Do you make a living writing comedy for big film or TV studios? Your response to Steven D'Aprano's "That's six wins versus one loss." should be hilarious. Or do you not respond to fact based posts? -- Cheers. Mark Lawrence.