Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.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.034 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'python': 0.09; 'skip:k 40': 0.09; 'subject:string': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; '3.2.': 0.16; 'instead:': 0.16; 'rewriting': 0.16; 'subject:unicode': 0.16; 'wrote:': 0.17; 'memory': 0.18; 'cc:2**0': 0.23; 'example': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; '20%': 0.29; 'received:google.com': 0.34; 'text': 0.34; 'received:209.85': 0.35; 'there': 0.35; 'received:209': 0.37; 'subject:: ': 0.38; 'from:no real name:2**0': 0.60; 'subject:, ': 0.61; 'subject:...': 0.63; 'gain': 0.79; 'otten': 0.84; 'subject:, ...': 0.84; 'received:209.85.213.184': 0.91; 'received:mail- yx0-f184.google.com': 0.91 Newsgroups: comp.lang.python Date: Sun, 2 Sep 2012 22:39:44 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=83.78.172.12; posting-account=ung4FAoAAAC46zhHJ0Nsnuox7M5gDvs_ References: <503a0d51$0$6574$c3e8da3$5496439d@news.astraweb.com> <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> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 83.78.172.12 MIME-Version: 1.0 Subject: Re: Flexible string representation, unicode, typography, ... From: wxjmfauth@gmail.com To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org 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: , Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346650787 news.xs4all.nl 6873 [2001:888:2000:d::a6]:56318 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28338 Le dimanche 2 septembre 2012 14:01:18 UTC+2, Serhiy Storchaka a =E9crit=A0: > On 02.09.12 12:52, Peter Otten wrote: >=20 > > Ian Kelly wrote: >=20 > > >=20 > >> Rewriting the example to use locale.strcoll instead: >=20 > > >=20 > >>>>> sorted(li, key=3Dfunctools.cmp_to_key(locale.strcoll)) >=20 > > >=20 > > There is also locale.strxfrm() which you can use directly: >=20 > > >=20 > > sorted(li, key=3Dlocale.strxfrm) >=20 >=20 >=20 > Hmm, and with locale.strxfrm Python 3.3 20% slower than 3.2. With a memory gain =3D 0 since my text contains non-latin-1 characters! jmf