convert Unicode to lower/uppercase?

Neil Hodgson nhodgson at bigpond.net.au
Thu Sep 25 17:05:45 EDT 2003


jallan:
> martin at v.loewis.de (Martin v. Löwis) wrote
> > ...
> > This is a contradiction: SpecialCasing contains 1:n mappings, whereas
> > .upper() can only return a single result. So how do you think
> > SpecialCasing should be considered in the implementation of .upper()?
>
> I am not aware that it is philosophically a *necessary* feature of
> .upper() that a single character not be replaced by a string of two or
> more characters.

   That is not the issue. The issue is that .upper would have to return a
list or map of results (for an illustrative but incorrect example
"ca~non".upper() -> {'portugal':'CANON','spain':'CA~NON'}), which would be
difficult for the caller to make use of without performing some additional
work, finding the correct result for its locale. It is simpler for the
caller to provide a locale argument in the .upper call or in its context.

   Neil






More information about the Python-list mailing list