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)

Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to