.title() - annoying mistake

Abdur-Rahmaan Janhangeer arj.python at gmail.com
Fri Mar 19 15:47:03 EDT 2021


At least i'd expect what it pretends to do
even if not following English.

Missing ' is a weird behaviour, i get it
they skipped every non lettet


On Fri, 19 Mar 2021, 22:50 Grant Edwards, <grant.b.edwards at gmail.com> wrote:

>
> 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'
>


More information about the Python-list mailing list