[Tutor] sort() method and non-ASCII

boB Stepp robertvstepp at gmail.com
Sat Feb 4 22:52:47 EST 2017


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?  If yes, then
my expectation would be that the French "á" would come after the "z"
character.  I am not ready to get into the guts of Unicode.  I am
quite happy now to leave Python 3 at its default UTF-8 and strictly
type in the ASCII subset of UTF-8.  But I know I will eventually have
to get into this, so I thought I would ask about sorting so I don't
get any evil surprises with some text file I might have to manipulate
in the future.

Thanks!

-- 
boB


More information about the Tutor mailing list