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 rhettinger
Recipients ezio.melotti, gvanrossum, markon, nickd, pitrou, r.david.murray, rhettinger, twb
Date 2009-09-28.22:21:34
SpamBayes Score 4.718448e-15
Marked as misclassified No
Message-id <1254176496.63.0.916247854708.issue7008@psf.upfronthosting.co.za>
In-reply-to
Content
Guido, do you have an opinion on whether to have str.title() handle
embedded apostrophes, "you're" --> "You're" instead of "You'Re"?

IMO, the problem comes-up often enough that people are looking for
workarounds (i.e. string.capwords() was a failed hack created to handle
the problem and django.titlecase() is a successful attempt at a workaround).

I'm not worried about Antoines's comment that we can't change anything
ever.  I am concerned about his point (mentioned on IRC) that there are
no context free solutions (the absolute right answer is hard).  While
the change would seem to always be helpful in an English context, in
French the proper title casing of "l'argent" is "L'Argent".  Then again,
there are cases in French that don't work under either method (i.e.
title casing Amaury Forgeot d'Arc ends-up capitalizing the D no matter
what we do).

Options:

1. Leave everything the same (rejecting requests for apostrophe handling
and forever live with the likes of You'Re).

2. Handle embedded single apostrophes, fixing most cases in English, and
wreaking havoc on the French (who are going to be ill-served under any
scenario).

3. Add an optional argument to str.title() with a list of characters
that will not trigger a transition.  This lets people add apostrophes
and hyphens and other characters of interest.  Hyphens are hard because
cases like mother-in-law should properly be converted to Mother-in_Law
and hyphens get used in many odd ways.

4. Add a new string method for handling title case with embedded
apostrophes but leaving the old version unchanged.

My order of preferences is 2,4,3,1.
History
Date User Action Args
2009-09-28 22:21:36rhettingersetrecipients: + rhettinger, gvanrossum, pitrou, ezio.melotti, r.david.murray, markon, twb, nickd
2009-09-28 22:21:36rhettingersetmessageid: <1254176496.63.0.916247854708.issue7008@psf.upfronthosting.co.za>
2009-09-28 22:21:35rhettingerlinkissue7008 messages
2009-09-28 22:21:34rhettingercreate