HN Top New Show Ask Jobs

settings

Theme

Hand Mode

Feed

Comment by zahlman

Comment by zahlman 6 hours ago

0 replies

View on Hacker News

Both .casefold() and .lower() in Python use the default Unicode casing algorithms. They're unicode-aware, but locale-naive. So .lower() also works for this purpose; the point of .casefold() is more about the intended semantics.

See also: https://stackoverflow.com/questions/19030948 where someone sought the locale-sensitive behaviour.