On 2021-03-21, Chris Angelico <ros...@gmail.com> wrote:
> On Mon, Mar 22, 2021 at 2:16 AM Robert Latest via Python-list 
> <python-list@python.org> wrote:
>
>> I wonder if .title() properly capitalizes titles in any language. It doesn't 
>> in
>> English (nor does it purport to), so it begs the question why it is there in
>> the first place. German and Spanish don't have any special capitalization 
>> rules
>> for titles; I don't know about any other languages.
>>
>
> It correctly title-cases a single character, as has been pointed out
> already.

Not according to the docs. The doc states that .title() converts the
first character characger in each "word" to _upper_ case. Is the doc
wrong?

If you want titlecase, then you should call str.capitalize() which
(again according to the doc) converts the first character to _title_
case (starting in v3.8).

--
Grant


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to