Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!panix!roy From: Roy Smith Newsgroups: comp.lang.python Subject: Re: Flexible string representation, unicode, typography, ... Date: Sun, 02 Sep 2012 08:35:13 -0400 Organization: PANIX Public Access Internet and UNIX, NYC Lines: 26 Message-ID: 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> NNTP-Posting-Host: localhost X-Trace: reader1.panix.com 1346589313 363 127.0.0.1 (2 Sep 2012 12:35:13 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Sun, 2 Sep 2012 12:35:13 +0000 (UTC) User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Xref: csiph.com comp.lang.python:28269 In article , Mark Lawrence wrote: > On 02/09/2012 13:00, Serhiy Storchaka wrote: > > 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. > > > > > > That's it then I'm giving up with Python. In future I'll be writing > everything in machine code to ensure that I get the fastest possible run > times. Feh. You software guys are always too willing to sacrifice performance for convenience. If you really want speed, grab yourself a handful of chips and a soldering iron.