Marc-Andre Lemburg <m...@egenix.com> added the comment: 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4610> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com