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.

Author gvanrossum
Recipients ezio.melotti, gvanrossum, markon, nickd, nnorwitz, pitrou, r.david.murray, rhettinger, twb
Date 2009-09-28.23:02:51
SpamBayes Score 8.568979e-12
Marked as misclassified No
Message-id <1254178973.99.0.0865778223053.issue7008@psf.upfronthosting.co.za>
In-reply-to
Content
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 string.capwords('A  B\tC\r\nD') returns 'A 
B C D'.

The title() method exists primarily because the Unicode standard has a 
definition of "title case".  I wouldn't want to change its default 
behavior because there is no reasonable behavior that isn't locale-
dependent, and Unicode methods shouldn't depend on locale; and even then 
it won't be perfect, as the O'Brien example shows.

Also note that .title() matches .istitle() in the sense that 
x.title().istitle() is supposed to be true (except in end cases like a 
string containing no letters).

I worry that providing an API that adds a way to specify a set of 
characters to be treated as letters (for the purpose of deciding where 
words start) will just make the bugs in apps harder to find because the 
examples are rarer (like "l'Aperitif" or "O'Brien" -- or "RSVP" for that 
matter).  With the current behavior at least app authors will easily 
notice the problem, decide whether it matters to them, and implement 
their own algorithm if they do.  And they are free to be as elaborate or 
simplistic as they care.

What's a realistic use case for .title() anyway?

(Proposal: close as won't fix.)
History
Date User Action Args
2009-09-28 23:02:54gvanrossumsetrecipients: + gvanrossum, nnorwitz, rhettinger, pitrou, ezio.melotti, r.david.murray, markon, twb, nickd
2009-09-28 23:02:53gvanrossumsetmessageid: <1254178973.99.0.0865778223053.issue7008@psf.upfronthosting.co.za>
2009-09-28 23:02:52gvanrossumlinkissue7008 messages
2009-09-28 23:02:51gvanrossumcreate