[Python-Dev] Pointy brackets for value patterns in Structural Pattern Matching

2020-11-13 Thread Richard Kleijn
(my first post here after years of lurking) PEP 635 mentions: "A proposed rule to use a leading dot (e.g. .CONSTANT) for that purpose was criticised because it was felt that the dot would not be a visible-enough marker for that purpose. Partly inspired by forms found in other programming

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-13 Thread Greg Ewing
On 14/11/20 9:33 am, Jim J. Jewett wrote: I *hope* this was a typo! If case Point(x=a, y=b): assigns to a and b (instead of x and y, as in a normal call), then that is ... going to be very easy for me to forget, and to miss even when I'm aware of it. I don't think it is a typo,

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-13 Thread Greg Ewing
On 14/11/20 7:45 am, Brandt Bucher wrote: with (using your own syntactic flavor): ``` case >first, *>middle, >last: rebuilt = first, *middle, last case {"key": >value, **>rest}: rebuilt = {"key": value, **rest} case Point(x=>a, y=>b): rebuilt = Point(x=a, y=b) I think this is a

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-13 Thread Glenn Linderman
On 11/13/2020 1:48 PM, Joao S. O. Bueno wrote: On Fri, 13 Nov 2020 at 17:36, Jim J. Jewett > wrote: I *hope* this was a typo!  If     case Point(x=a, y=b): assigns to a and b (instead of x and y, as in a normal call), then that is ... going to

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-13 Thread Joao S. O. Bueno
On Fri, 13 Nov 2020 at 17:36, Jim J. Jewett wrote: > I *hope* this was a typo! If > > case Point(x=a, y=b): > > assigns to a and b (instead of x and y, as in a normal call), then that is > ... going to be very easy for me to forget, and to miss even when I'm aware > of it. > No typo -

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-13 Thread Jim J. Jewett
I *hope* this was a typo! If case Point(x=a, y=b): assigns to a and b (instead of x and y, as in a normal call), then that is ... going to be very easy for me to forget, and to miss even when I'm aware of it. -jJ ___ Python-Dev mailing list --

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-13 Thread Joao S. O. Bueno
On Fri, 13 Nov 2020 at 15:53, Brandt Bucher wrote: > Paul Sokolovsky wrote: > > Use punctuation ("sigils") to mark as-binding terms. This choice still > seems to be under-considered. (As in: it doesn't seem like many people, > including the PEP authors, tried to say "indeed, what if?" and feel

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-13 Thread Brandt Bucher
Paul Sokolovsky wrote: > Use punctuation ("sigils") to mark as-binding terms. This choice still seems > to be under-considered. (As in: it doesn't seem like many people, including > the PEP authors, tried to say "indeed, what if?" and feel thru it. I mean, > try really hard. I trust the "gang

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-13 Thread Brett Cannon
On Thu, Nov 12, 2020 at 11:41 PM Paul Sokolovsky wrote: > Hello, > > On Thu, 12 Nov 2020 12:51:19 -0800 > Guido van Rossum wrote: > > > I have a meta-observation. Clearly there are too many cooks here. The > > same suggestions keep getting brought up. We will never converge on a > > design this

[Python-Dev] Summary of Python tracker Issues

2020-11-13 Thread Python tracker
ACTIVITY SUMMARY (2020-11-06 - 2020-11-13) Python tracker at https://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open7628 (+11) closed 46459 (+62) total 54087 (+73) Open issues

[Python-Dev] Re: Please do not remove random bits of information from the tutorial

2020-11-13 Thread Steve Holden
On Thu, Nov 12, 2020 at 8:49 PM Guido van Rossum wrote: > The correct place for the docs for __cause__ and __context__ is in the > section in the library reference about exceptions. There's quite a bit > about them there already. That's where the tutorial should link as well. > > And now I ask

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-13 Thread Baptiste Carvello
Hi, Le 12/11/2020 à 18:55, Guido van Rossum a écrit : > The position of PEP 622/634/535/636 authors is clear: well, let me first emphasize that I did *not* mean to reopen the discussion on those PEPs, which explain and discuss their design choices thoroughly (even better since the rewrite,

[Python-Dev] Re: Words rather than sigils in Structural Pattern Matching

2020-11-13 Thread Luciano Ramalho
On Thu, Nov 12, 2020 at 8:41 PM David Mertz wrote: > One idea that I cannot recall seeing, but that seems to make sense to me and > fit with Python's feel is using a WORD to distinguish between a variable > value and a binding target. That is, instead of a special symbol prefixing > or

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-13 Thread Paul Sokolovsky
Hello, On Fri, 13 Nov 2020 21:51:49 +1100 Steven D'Aprano wrote: > > match foo: > > case ("foo", >val1): > > ... > > case ("bar", >val2): > > ... > > > 1. Much more intuitive for beginners. (If Python adopts it, I see > > other "user-friendly" languages adopting the

[Python-Dev] Re: PEP 642 v2: Explicit constraint patterns *without* question marks in the syntax

2020-11-13 Thread Steven D'Aprano
On Thu, Nov 12, 2020 at 09:40:02PM +0300, Paul Sokolovsky wrote: > match foo: > case ("foo", >val1): > ... > case ("bar", >val2): > ... > 1. Much more intuitive for beginners. (If Python adopts it, I see > other "user-friendly" languages adopting the same pattern in the