[Python-ideas] Re: f-strings as assignment targets

2020-10-21 Thread David Mertz
On Thu, Oct 22, 2020 at 4:17 AM Guido van Rossum wrote: > In terms of API, assuming functions, I think there are two basic models. > We could have two (or more) functions that were related though: >> >> # E.g. pat_with_names = "{foo:f}/{bar:4s}/{baz:3d}" >> matches = scan_to_obj(pat_with_names, h

[Python-ideas] Re: f-strings as assignment targets

2020-10-21 Thread Guido van Rossum
On Wed, Oct 21, 2020 at 7:12 PM David Mertz wrote: > To bring it back to a concrete idea, here's how I see things: > >1. The idea of f-string-like assignment targets has little support. >Only Chris, and maybe the OP who seems to have gone away. >2. The idea of a "scanning language" se

[Python-ideas] Re: f-strings as assignment targets

2020-10-21 Thread David Mertz
To bring it back to a concrete idea, here's how I see things: 1. The idea of f-string-like assignment targets has little support. Only Chris, and maybe the OP who seems to have gone away. 2. The idea of a "scanning language" seems to garner a fair amount of enthusiasm from everyone who

[Python-ideas] Re: f-strings as assignment targets

2020-10-21 Thread Guido van Rossum
If I was the list moderator, at this point I would put the thread on a "cooling off" timeout for 8-16 hours. Both of you seem to be mainly complaining about each other's interaction style rather than adding anything of substance. Then again neither am I so why am I even writing this. :-) On Wed,

[Python-ideas] Re: f-strings as assignment targets

2020-10-21 Thread Chris Angelico
On Thu, Oct 22, 2020 at 10:36 AM Steven D'Aprano wrote: > > On Wed, Oct 21, 2020 at 12:16:16PM +1100, Chris Angelico wrote: > > > Please explain how it's "spooky action at a distance" if it's a > > self-contained assignment statement? > > "Spooky action at a distance" is your phrase, not mine, or

[Python-ideas] Re: f-strings as assignment targets

2020-10-21 Thread Steven D'Aprano
On Wed, Oct 21, 2020 at 12:16:16PM +1100, Chris Angelico wrote: > Please explain how it's "spooky action at a distance" if it's a > self-contained assignment statement? "Spooky action at a distance" is your phrase, not mine, or Rob's. (I think David Mertz may have used it first, but I don't have

[Python-ideas] Re: f-strings as assignment targets

2020-10-21 Thread David Mertz
On Wed, Oct 21, 2020, 7:21 PM Steven D'Aprano > There's a middle ground of text parsing tasks that would seem to be a good > match for some sort of scanner, inspired by C's scanf, whether it uses % or > {} format codes. > Maybe COBOL PICTURE clauses. Admittedly, I've never used COBOL, but I thou

[Python-ideas] Re: f-strings as assignment targets

2020-10-21 Thread Steven D'Aprano
On Wed, Oct 21, 2020 at 11:07:28AM -0700, Christopher Barker wrote: > As for the question of do we need a scanning language at all? We already > have pretty full features string methods, and regex for the complex stuff. > > I think yes -- for both simplicity for the simple stuff (the easy stuff >

[Python-ideas] Re: Consolidated ideas

2020-10-21 Thread Chris Angelico
On Thu, Oct 22, 2020 at 5:35 AM Madhu Mohan Nelemane wrote: > > Hi, > > I have been programming in python for about 6 years now. However, I am a > newbie to this mailing list. My observation in the last couple of days is > that this is literally an explosion of ideas and in various degrees. I am

[Python-ideas] Consolidated ideas

2020-10-21 Thread Madhu Mohan Nelemane
Hi, I have been programming in python for about 6 years now. However, I am a newbie to this mailing list. My observation in the last couple of days is that this is literally an explosion of ideas and in various degrees. I am wondering if there is a common place or site where the ideas that went be

[Python-ideas] Re: Inconsistency in splitting strings

2020-10-21 Thread Ben Rudiak-Gould
On Tue, Oct 20, 2020 at 8:57 AM Antal Gábor wrote: > My idea is to return a list with an empty string in all cases mentioned > above. > This will never be fixed in 3.x, but if it's fixed in The Version That Must Not Be Named, my preference would be that they all return [] because then it's easy

[Python-ideas] Re: Inconsistency in splitting strings

2020-10-21 Thread Christopher Barker
Interesting. I agree that this is inconsistent and confusing (and I'm quite curious how the implementation ended up this way). But I have literally NEVER been bitten by this -- perhaps it's because I WAS bitten by it way back when, and then started the habit of ignoring empty strings before I spl

[Python-ideas] Re: f-strings as assignment targets

2020-10-21 Thread Christopher Barker
On Tue, Oct 20, 2020 at 12:14 PM David Mertz wrote: > Well, "formatting" more generally, not only printing. But the fact they > are different is EXACTLY the point I have tried to make a number of times. > Trying to shoe-horn a "formatting string" into a role of a "scanning > string" is exactly t

[Python-ideas] Re: Call a function at invocation

2020-10-21 Thread Christopher Barker
FWIW, one of my intro students just yesterday asked about this: Is there a way to call a function in a python file directly from the command line? I have no idea what their programming background is, or why they expected that to be possible, but there you go -- at least one newbie expected it to

[Python-ideas] Re: Bringing the print statement back

2020-10-21 Thread Andrew Svetlov
Agree with Serhiy. IIRC Ruby allows skipping brackets for a function call, this is very confusing sometimes On Tue, Oct 20, 2020, 18:54 Antal Gábor wrote: > Couldn't agree more. > > On 2020. 10. 20. 16:43, Serhiy Storchaka wrote: > > 20.10.20 12:54, J. Pic пише: > >> At the same time, Guido says

[Python-ideas] Re: Optimize out setting unused underscored local variables

2020-10-21 Thread André Roberge
On Wed, Oct 21, 2020 at 3:02 AM Serhiy Storchaka wrote: > 21.10.20 05:23, Steve Barnes пише: > > Of course there is also the problem of detecting any functions assigned > > to _ or _T that may be called - otherwise there is a risk of breaking > > the typical gettext usage in I18n! > > gettext is