Flexible string representation, unicode, typography, ...

Roy Smith roy at panix.com
Sun Sep 2 08:35:13 EDT 2012


In article <mailman.84.1346588596.27098.python-list at python.org>,
 Mark Lawrence <breamoreboy at yahoo.co.uk> 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.



More information about the Python-list mailing list