Oh yeah. Good points! Do we need a PEP for str.upper() to grow an optional
'locale' argument? I feel like there are examples other than the Turkish
i's where this matters, but it's past my bedtime, so they aren't coming to
mind.

Maybe Koine Greek which had not adopted the miniscule/majuscule distinction
of post 10th century CE that modern Greek inherited. I feel like
`s.upper(locale='koine')` might sensibly account for this.

On Wed, Dec 21, 2022, 1:23 AM Chris Angelico <ros...@gmail.com> wrote:

> On Wed, 21 Dec 2022 at 17:20, David Mertz, Ph.D. <david.me...@gmail.com>
> wrote:
> >
> > I'm on my tablet, so cannot test at the moment. But is `str.upper()`
> REALLY wrong about the Turkish dotless I (and dotted capital I) currently?!
> >
> > That feels like a BPO needed if true.
>
> It's wrong about the ASCII i and I, which upper and lower case to each
> other. There's no way for str.upper() to be told what language it's
> working with, so it goes with a default that's valid for every
> language except Turkish and its friends. This also means that
> lowercasing "İ" will give "i" which uppercases to "I", so it doesn't
> round-trip. There is no solution other than a language-aware case
> transformation.
>
> ChrisA
> _______________________________________________
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/P7VDKYKVEHYQT4HKQJPLSCZIKVVWYF46/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/F3VEWT2QEWJQ2F65EBLNYMW5KOFM7NI5/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to