Re: .title() - annoying mistake

2021-03-21 Thread Chris Angelico
On Mon, Mar 22, 2021 at 2:00 PM Richard Damon wrote: > Basically, titlecasing a word IS making the first letter upper case and > the rest lower case UNLESS the first letter is on of the 31 digraphs > which have a special titlecase version, then that is used for the first > letter. That gets pretty

Re: .title() - annoying mistake

2021-03-21 Thread Richard Damon
On 3/21/21 10:28 PM, Chris Angelico wrote: > On Mon, Mar 22, 2021 at 12:26 PM Richard Damon > wrote: >> On 3/21/21 7:31 PM, MRAB wrote: >>> On 2021-03-21 22:30, Chris Angelico wrote: On Mon, Mar 22, 2021 at 9:04 AM Grant Edwards wrote: > On 2021-03-21, Chris Angelico wrote: >>

Re: Pips for python2 and python3

2021-03-21 Thread MRAB
On 2021-03-22 01:34, Tim Johnson wrote: On 3/21/21 5:14 PM, MRAB wrote: Tn 2021-03-21 23:13, Tim Johnson wrote: Using ubuntu 20.04 as a recent install with python3 (3.8.5) which was installed as part of the original distribution install and python2 (2.7.18) that has been installed using apt.

Re: .title() - annoying mistake

2021-03-21 Thread Chris Angelico
On Mon, Mar 22, 2021 at 12:26 PM Richard Damon wrote: > > On 3/21/21 7:31 PM, MRAB wrote: > > On 2021-03-21 22:30, Chris Angelico wrote: > >> On Mon, Mar 22, 2021 at 9:04 AM Grant Edwards > >> wrote: > >>> > >>> On 2021-03-21, Chris Angelico wrote: > >>> > On Mon, Mar 22, 2021 at 2:16 AM Robert

Re: Pips for python2 and python3

2021-03-21 Thread Tim Johnson
On 3/21/21 5:14 PM, MRAB wrote: Tn 2021-03-21 23:13, Tim Johnson wrote: Using ubuntu 20.04 as a recent install with python3 (3.8.5) which was installed as part of the original distribution install and python2 (2.7.18) that has been installed using apt. I have a large amount of utilities writt

Re: Pips for python2 and python3

2021-03-21 Thread Dan Stromberg
On Sun, Mar 21, 2021 at 6:14 PM MRAB wrote: > Tn 2021-03-21 23:13, Tim Johnson wrote: > > Using ubuntu 20.04 as a recent install > > with python3 (3.8.5) which was installed as part of the > > original distribution install > > and > > python2 (2.7.18) that has been installed using apt. > > > > I

Re: .title() - annoying mistake

2021-03-21 Thread Richard Damon
On 3/21/21 7:31 PM, MRAB wrote: > On 2021-03-21 22:30, Chris Angelico wrote: >> On Mon, Mar 22, 2021 at 9:04 AM Grant Edwards >> wrote: >>> >>> On 2021-03-21, Chris Angelico wrote: >>> > On Mon, Mar 22, 2021 at 2:16 AM Robert Latest via Python-list >>> wrote: >>> > >>> >> I wonder if .title() pr

Re: Pips for python2 and python3

2021-03-21 Thread MRAB
Tn 2021-03-21 23:13, Tim Johnson wrote: Using ubuntu 20.04 as a recent install with python3 (3.8.5) which was installed as part of the original distribution install and python2 (2.7.18) that has been installed using apt. I have a large amount of utilities written in python2 which I need to maint

Pips for python2 and python3

2021-03-21 Thread Tim Johnson
Using ubuntu 20.04 as a recent install with python3 (3.8.5) which was installed as part of the original distribution install and python2 (2.7.18) that has been installed using apt. I have a large amount of utilities written in python2 which I need to maintain until I convert that code to python

Re: .title() - annoying mistake

2021-03-21 Thread MRAB
On 2021-03-21 22:30, Chris Angelico wrote: On Mon, Mar 22, 2021 at 9:04 AM Grant Edwards wrote: On 2021-03-21, Chris Angelico wrote: > On Mon, Mar 22, 2021 at 2:16 AM Robert Latest via Python-list wrote: > >> I wonder if .title() properly capitalizes titles in any language. It doesn't in >

Re: .title() - annoying mistake

2021-03-21 Thread Chris Angelico
On Mon, Mar 22, 2021 at 9:04 AM Grant Edwards wrote: > > On 2021-03-21, Chris Angelico wrote: > > On Mon, Mar 22, 2021 at 2:16 AM Robert Latest via Python-list > > wrote: > > > >> I wonder if .title() properly capitalizes titles in any language. It > >> doesn't in > >> English (nor does it pur

Re: .title() - annoying mistake

2021-03-21 Thread Benjamin Schollnick
>> Heck, how do we prevent it from titlecasing abbreviations? (This is plain >> text not XML…. If it was XML it would be easy!) > > We haven't managed to teach humans how to do that, so I doubt we'll > ever teach a simple standard library function to do it. > > *cough*XMLHttpRequest*cough* Tr

thought

2021-03-21 Thread Quentin Bock
Note: Previous comments have been made on this, this is my reply to another response of this question. I would have it so, the "admin" of the program would be able to change if devices are allowed on that network, and would also be able to remove and make certain devices always receive a password t

Re: .title() - annoying mistake

2021-03-21 Thread Grant Edwards
On 2021-03-21, Chris Angelico wrote: > On Mon, Mar 22, 2021 at 2:16 AM Robert Latest via Python-list > 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 plac

Re: .title() - annoying mistake

2021-03-21 Thread Grant Edwards
On 2021-03-20, Alan Bawden wrote: > Sibylle Koczian writes: > >Am 20.03.2021 um 09:34 schrieb Alan Bawden: >> >> When you write that code to capitalize your book titles, you should be >> calling .title() rather than .upper() if you are doing it right. >> >But that's exactl

Re: .title() - annoying mistake

2021-03-21 Thread Grant Edwards
On 2021-03-20, Robert Latest via Python-list wrote: > Mats Wichmann wrote: >> The problem is that there isn't a standard for title case, > > The problem is that we owe the very existence of the .title() method to too > much weed being smoked during Python development. It makes specific > assumpti

Re: .title() - annoying mistake

2021-03-21 Thread Richard Damon
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 en

Re: thought

2021-03-21 Thread Chris Angelico
On Mon, Mar 22, 2021 at 6:03 AM Quentin Bock wrote: > > I had a recent thought about someone's wifi/network connection and password. > Could it be possible to create a program that will randomize a new password > every 24 hours (letters and numbers) and when the program is opened (or > notificatio

Re: .title() - annoying mistake

2021-03-21 Thread Chris Angelico
On Mon, Mar 22, 2021 at 5:40 AM Benjamin Schollnick wrote: > Heck, how do we prevent it from titlecasing abbreviations? (This is plain > text not XML…. If it was XML it would be easy!) We haven't managed to teach humans how to do that, so I doubt we'll ever teach a simple standard library func

thought

2021-03-21 Thread Quentin Bock
I had a recent thought about someone's wifi/network connection and password. Could it be possible to create a program that will randomize a new password every 24 hours (letters and numbers) and when the program is opened (or notification would be sent) you can see the new password to log into the w

Re: .title() - annoying mistake

2021-03-21 Thread Benjamin Schollnick
> 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 uppercas

Re: .title() - annoying mistake

2021-03-21 Thread Paul Bryan
The topic of titles is complex, and would be significant undertaking to automate. It's not only highly language-dependent, it's also based on the subject work itself, and subject to guidelines of those charged with indexing such works. MusicBrainz guidelines: https://wiki.musicbrainz.org/Style/Tit

Re: .title() - annoying mistake

2021-03-21 Thread Chris Angelico
On Mon, Mar 22, 2021 at 2:16 AM Robert Latest via Python-list wrote: > > Chris Angelico wrote: > > On Sun, Mar 21, 2021 at 10:31 PM Robert Latest via Python-list > > wrote: > >> Yes, I get that. But the purpose it (improperly) serves only makes sense in > >> the English language. > > > > Why? Do t

Re: .title() - annoying mistake

2021-03-21 Thread Robert Latest via Python-list
Chris Angelico wrote: > On Sun, Mar 21, 2021 at 10:31 PM Robert Latest via Python-list > wrote: >> Yes, I get that. But the purpose it (improperly) serves only makes sense in >> the English language. > > Why? Do titles not exist in other languages? Does no other language > capitalize words in book

Re: .title() - annoying mistake

2021-03-21 Thread Robert Latest via Python-list
Benjamin Schollnick wrote: > > I’m sorry Robert, but just because it doesn’t meet your requirements, doesn’t > mean it’s useless. > > I use .title to normalize strings for data comparison, all the time. It’s a > perfect alternative to using .UPPER or .lower. > > Right in the documentation, it sp

Re: .title() - annoying mistake

2021-03-21 Thread Richard Damon
On 3/21/21 8:19 AM, Albert-Jan Roskam wrote: >On 20 Mar 2021 23:47, Cameron Simpson wrote: > > On 20Mar2021 12:53, Sibylle Koczian wrote: > >Am 20.03.2021 um 09:34 schrieb Alan Bawden: > >>The real reason Python strings support a .title() method is surely > >>because Unico

Re: .title() - annoying mistake

2021-03-21 Thread Albert-Jan Roskam
On 20 Mar 2021 23:47, Cameron Simpson wrote: On 20Mar2021 12:53, Sibylle Koczian wrote: >Am 20.03.2021 um 09:34 schrieb Alan Bawden: >>The real reason Python strings support a .title() method is surely >>because Unicode supports upper, lower, _and_ title case letters, and

Re: .title() - annoying mistake

2021-03-21 Thread Chris Angelico
On Sun, Mar 21, 2021 at 10:31 PM Robert Latest via Python-list wrote: > > Chris Angelico wrote: > > On Sun, Mar 21, 2021 at 4:31 AM Robert Latest via Python-list > > wrote: > >> > >> Mats Wichmann wrote: > >> > The problem is that there isn't a standard for title case, > >> > >> The problem is tha

Re: .title() - annoying mistake

2021-03-21 Thread Benjamin Schollnick
>> The problem is that you haven't read the documentation :) It very carefully >> does NOT define itself by language, and its behaviour is identical regardless >> of the language used. > > The documentation says: "The algorithm uses a simple language-independent > definition of a word as groups of

Re: .title() - annoying mistake

2021-03-21 Thread Robert Latest via Python-list
Chris Angelico wrote: > On Sun, Mar 21, 2021 at 4:31 AM Robert Latest via Python-list > wrote: >> >> Mats Wichmann wrote: >> > The problem is that there isn't a standard for title case, >> >> The problem is that we owe the very existence of the .title() method to too >> much weed being smoked durin