Message191750
| Author |
lemburg |
| Recipients |
alexs, belopolsky, ezio.melotti, lemburg, loewis, rhettinger, senn |
| Date |
2013年06月24日.08:23:49 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<51C80212.1060904@egenix.com> |
| In-reply-to |
<1372027974.81.0.239544434741.issue4610@psf.upfronthosting.co.za> |
| Content |
On 24.06.2013 00:52, Alexander Belopolsky wrote:
>
> Alexander Belopolsky added the comment:
>
> There has been a relatively recent discussion of case mappings under #12753 (msg144836).
>
> I personally agree with Martin: str.upper/lower should remain the way it is - a simplistic 1-to-1 mapping using UnicodeData.txt fields. More sophisticated case mapping algorithms belong to a specialized library module not python core.
>
> The behavior of .title() and .capitalize() is harder to defend, so if someone can point out to a python library (PyICU?) that gets it right we can reference it in the documentation.
.title() and .capitalize() are 1-1 mappings as well. Python only supports
"Simple Case Operations" and does not support "Full Case Operations"
which require parsing context (SpecialCasing.txt).
ICU does provide support for both:
http://userguide.icu-project.org/transforms/casemappings
PyICU wraps ICU, but it is not clear to me how you'd access those
mappings (the package doesn't provide dcoumentation on the API, instead
just gives a description of how to map the C++ API to a Python one):
https://pypi.python.org/pypi/PyICU |
|