Flexible string representation, unicode, typography, ...

Mark Lawrence breamoreboy at yahoo.co.uk
Mon Sep 3 02:11:06 EDT 2012


On 03/09/2012 06:39, wxjmfauth at 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.




More information about the Python-list mailing list