Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
I agree with the OP that str.title should be made smarter. As it
stands, it is a likely bug factory that would pass unittests, then
generate unpleasant results with real user inputs.
Extending on Thomas's comment, I think
Thomas W. Barr t...@rice.edu added the comment:
If correct handling of apostrophe's and quotation marks, keeping the
string length unchanged, and only changing desired letters from lower to
uppercase with no other side-effects is the criterion we want, then
what I suggested (toupper() the first
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
I'm still researching what other languages do. MS-Excel matches what
Python currently does. Django uses the python version and then fixes-up
apostrophe errors:
title=lambda value: re.sub(([a-z])'([A-Z]), lambda m:
Guido van Rossum gu...@python.org added the comment:
Raymond, please refrain from emotional terms like bug factory.
I have nothing to say about whether string.capwords() should be removed,
but I want to note that it does a split on whitespace and then rejoins
using a single space, so that