[EMAIL PROTECTED] writes: > Arnaud Delobelle: >> Here's another idea, probably more practical: >> >>> sorted(s, key=lambda x: tuple(256-ord(l) for l in x), reverse=True) > > Nice. > A variant that probably works with unicode strings too: > > print sorted(s, key=lambda x: [-ord(l) for l in x], reverse=True)
Of course that's better! (although mine will work with unicode if yours does). It's funny how the obvious escapes me so often. Still I think the idea of the 'double reverse' (one letterwise, the other listwise) was quite good. -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list