This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 lemburg
收信人 alexs, ezio.melotti, lemburg, loewis, senn
日期 2009-10-14.20:26:09
SpamBayes Score 1.4057222e-10
Marked as misclassified
Message-id <4AD633E4.9010301@egenix.com>
In-reply-to <1255546815.92.0.62328909151.issue4610@psf.upfronthosting.co.za>
内容
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.
历史
日期 用户 动作 参数
2009-10-14 20:26:11lemburg修改recipients: + lemburg, loewis, senn, ezio.melotti, alexs
2009-10-14 20:26:09lemburg链接issue4610 messages
2009-10-14 20:26:09lemburg创建