Flexible string representation, unicode, typography, ...

Serhiy Storchaka storchaka at gmail.com
Sun Sep 2 08:00:59 EDT 2012


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.





More information about the Python-list mailing list