[Tutor] sort() method and non-ASCII

Random832 random832 at fastmail.com
Sat Feb 4 23:50:47 EST 2017


On Sat, Feb 4, 2017, at 22:52, boB Stepp wrote:
> Does the list sort() method (and other sort methods in Python) just go
> by the hex value assigned to each symbol to determine sort order in
> whichever Unicode encoding chart is being implemented?

By default. You need key=locale.strxfrm to make it do anything more
sophisticated.

I'm not sure what you mean by "whichever unicode encoding chart". Python
3 strings are unicode-unicode, not UTF-8.


More information about the Tutor mailing list