
On Sat, 24 Dec 2022 at 09:07, Cameron Simpson <cs@cskk.id.au> wrote:
On 23Dec2022 22:27, Chris Angelico <rosuav@gmail.com> wrote:
I think this would be a useful feature to have, although it'll probably end up needing a LOT of information (you can't just say "give me a locale-correct uppercasing of this string" without further context). So IMO it should be third-party.
It would probably be good to have a caveat mentioning these context difficulties in the docs of the unicodedata and str/string case fiddling methods. Not a complete exposition, but making it clear that for some languages the rules require context, maybe with a hard-to-implement-correctly example of naive/incorrect use.
Do people actually read those warnings? Hang on, lemme pop into the time machine and add one to the docstring and docs for str.upper(). Okay, I'm back. Tell me, have you read the docstring? Do you know exactly what it says? For example, is there wording that clarifies whether x.upper() uppercases the string in-place? (I had to actually check that one myself, as I haven't memorized the docstring either.) ChrisA