.title() - annoying mistake

Richard Damon Richard at Damon-Family.org
Sun Mar 21 16:47:31 EDT 2021


On 3/21/21 2:39 PM, Benjamin Schollnick wrote:
>> 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.  
>
> I’ll agree that if title was to respect language definitions, that there would be a problem here…  But it specifically states otherwise.
>
> And as I mentioned the sheer amount of work that would be needed would probably cover a phd dissertation or more…  It’s a huge problem set to respect one language, let alone all languages.  
>
> So the only answer is to not respect the languages, and leave that up to a later implementation or for someone else to assist in adding in support.
>
> Heck, how do we prevent it from titlecasing abbreviations?  (This is plain text not XML….  If it was XML it would be easy!)
>
> 	- Benjamin

One important thing to remember is that there ARE a few characters that
are themselves 'Title case', so we can't live with just upper and lower.
These all are 'digraphs', i.e. look like two letters, but this glyph
does act as a single character for many purposes. One example that has
been given is Dz which is different than Dz.

-- 
Richard Damon



More information about the Python-list mailing list