.title() - annoying mistake

Karsten Hilbert Karsten.Hilbert at gmx.net
Mon Mar 22 05:38:41 EDT 2021


Am Mon, Mar 22, 2021 at 09:22:51AM +0000 schrieb Robert Latest via Python-list:

> >> I agree with everything you say. Especially the open source part. But
> >> wouldn't you agree that .title() with all its arbitrary specificity to
> >> appear in the very core of a general purpose language is quite an oddity?
> >
> > No, because it book ends the issue.
> >
> > Upper - Converts everything to uppercase Lower - Converts everything to
> > lowercase
> >
> > Title - Covers the cases in-between upper/lower.
>
> My only issue is that I completely fail to see how this function would be
> useful enough to warrant the inclusion into the *core* of a general-purpose
> language, including its misleading name. The fact that the function's behavior
> is correctly documented doesn't make its very existence less bewildering to me.

Its naming may be unfortunate, its existence may be
bewildering. However, it's now there, and for historical
reasons, supposedly.

It won't be removed or renamed in all likelihood. The best
one can do is to suggest a documentation patch (not fix)
like so:

	The algorithm uses a simple language-independent

		[...] and context-naive, not locale related, [...]

	definition of a word [...]

and life with that wart.

Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B


More information about the Python-list mailing list