Flexible string representation, unicode, typography, ...

Peter Otten __peter__ at web.de
Sun Sep 2 05:52:14 EDT 2012


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)





More information about the Python-list mailing list