Peter Otten, 13.01.2010 13:25:
>>> items = "Atem Äther ähnlich anders".split()
>>> print " ".join(sorted(items, key=lambda s: s.lower()))

If you can make sure that 's' is either always a byte string or always a unicode string (which is good programming practice anyway), an unbound method can simplify (and speed up) the above, e.g.

    sorted(items, key=unicode.lower)

Stefan
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to