.title() - annoying mistake

dn PythonList at DancesWithMice.info
Fri Mar 19 15:33:32 EDT 2021


On 20/03/2021 07.49, Grant Edwards wrote:
> On 2021-03-19, MRAB <python at mrabarnett.plus.com> wrote:
>> You want English "man's" to become "Man's", but French "l'homme" to 
>> become "L'Homme". It's language-dependant.
> 
> In English, certain words are not capitalized in titles unless they're
> the first word in the title (short articles and prepositions), and
> .title() doesn't get that right either:
> 
>>>> "the man in the grey flannel suit".title()
> 'The Man In The Grey Flannel Suit'
> 
> should be
> 
> 'The Man in the Grey Flannel Suit'


To be fair, aren't book-titles* a (formalised) sub-set of the English
language?

https://www.librarianshipstudies.com/2018/12/anglo-american-cataloguing-rules-aacr.html

* plays, movies, ...

See also people's/family-names which have been anglicised or
transliterated...
-- 
Regards,
=dn


More information about the Python-list mailing list