Message94024
Jeff Senn wrote:
> However .capitalize() is a bit weird; and I'm not sure it isn't
> incorrectly implemented now:
>
> It UPPERCASES the first character, rather than TITLECASING, which is
> probably wrong in the very few cases where it makes a difference:
> e.g. (using Croatian ligatures)
>
>>>> u'\u01c5amonjna'.title()
> u'\u01c4amonjna'
>>>> u'\u01c5amonjna'.capitalize()
> u'\u01c5amonjna'
>
> "Capitalization" is not precisely defined (by the Unicode standard) --
> the currently python implementation doesn't even do what the docs say:
> "makes the first character have upper case" (it also lower-cases all
> other characters!), however I might argue that a more useful
> implementation "makes the first character have titlecase..."
You don't have to worry about .capitalize() and .swapcase() :-)
Those methods are defined by their implementation and don't resemble
anything defined in Unicode.
I agree that they are, well, not that useful. |
|
Date |
User |
Action |
Args |
2009-10-14 20:26:11 | lemburg | set | recipients:
+ lemburg, loewis, senn, ezio.melotti, alexs |
2009-10-14 20:26:09 | lemburg | link | issue4610 messages |
2009-10-14 20:26:09 | lemburg | create | |
|