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)