[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-02 Thread Nick Coghlan
On Sun., 1 Nov. 2020, 3:01 pm Guido van Rossum, wrote: > On Sat, Oct 31, 2020 at 21:48 Dan Stromberg wrote: > >> >> On Sat, Oct 31, 2020 at 9:37 PM Guido van Rossum >> wrote: >> >>> >>> I think this over-stresses the notion that users might want to override >>> the comparison operator to be use

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-02 Thread Nick Coghlan
On Sun, 1 Nov 2020 at 11:29, Nick Coghlan wrote: > On Sat., 31 Oct. 2020, 9:29 pm Steven D'Aprano, wrote: >> (4) Patterns which could conceivably be interpreted as assignment >> targets default to capture patterns, because that's what is normally >> wanted in pattern matching: >> >> >> case [

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-02 Thread Thomas Wouters
On Sat, Oct 31, 2020 at 12:25 PM Steven D'Aprano wrote: > > I really don't get why so many people are hung up over this minuscule > issue of giving `_` special meaning inside match statements. IMO, > consistency with other languages' pattern matching is more useful than > the ability to capture u

[Python-Dev] Re: Drop Solaris, OpenSolaris, Illumos and OpenIndiana support in Python

2020-11-02 Thread Jakub Kulík
Hi, that was me fixing Oracle Solaris related issues. To be completely honest, I wasn't sure if you would be interested in some of our patches, because I thought that Python works without issues on Illumos based systems and our patches might be very Oracle Solaris specific. It seems that I was wro

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-02 Thread Eric V. Smith
On 11/2/2020 9:31 AM, Thomas Wouters wrote: On Sat, Oct 31, 2020 at 12:25 PM Steven D'Aprano > wrote: I really don't get why so many people are hung up over this minuscule issue of giving `_` special meaning inside match statements. IMO, consistency wi

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-02 Thread Guido van Rossum
On Mon, Nov 2, 2020 at 1:14 PM Eric V. Smith wrote: > On 11/2/2020 9:31 AM, Thomas Wouters wrote: > > > > On Sat, Oct 31, 2020 at 12:25 PM Steven D'Aprano > wrote: > >> >> I really don't get why so many people are hung up over this minuscule >> issue of giving `_` special meaning inside match st

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-02 Thread Glenn Linderman
On 11/2/2020 1:42 PM, Guido van Rossum wrote: But we feel that `case x, x` can easily be misunderstood as "a tuple of two equal values" So what _is_ the syntax for "a tuple of two equal values" ? case x, ?x:  # comes to mind (not that it is in the PEP :)) __

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-02 Thread Ethan Furman
On 11/2/20 1:52 PM, Glenn Linderman wrote: On 11/2/2020 1:42 PM, Guido van Rossum wrote: But we feel that `case x, x` can easily be misunderstood as "a tuple of two equal values" So what _is_ the syntax for "a tuple of two equal values" ? case x, ?x:  # comes to mind (not that it is in the P

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-02 Thread Brandt Bucher
Glenn Linderman wrote: > So what _is_ the syntax for "a tuple of two equal values" ? If you’re asking about PEP 634: ``` case x, y if x == y: ``` Which is much clearer, in my opinion. ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-02 Thread Chris Angelico
On Tue, Nov 3, 2020 at 8:53 AM Glenn Linderman wrote: > > On 11/2/2020 1:42 PM, Guido van Rossum wrote: > > But we feel that `case x, x` can easily be misunderstood as "a tuple > > of two equal values" > > So what _is_ the syntax for "a tuple of two equal values" ? > > case x, ?x: # comes to mind

[Python-Dev] Re: PEP 642: Constraint Pattern Syntax for Structural Pattern Matching

2020-11-02 Thread Greg Ewing
On 3/11/20 11:01 am, Ethan Furman wrote: I believe supporting     case x, x   # look ma!  no guard! is a possible future enhancement. In which case there will be a need for *some* kind of true "don't care" placeholder. If it's not "_" then it will have to be something else like "?". And we

[Python-Dev] Re: Pattern matching reborn: PEP 622 is dead, long live PEP 634, 635, 636

2020-11-02 Thread Brett Cannon
On Fri, Oct 30, 2020 at 6:39 PM Tin Tvrtković wrote: > A small update on this, since I've been playing with it. > > I'm trying to implement a websocket proxy, since it's an example of a toy > project that needs to juggle two long-lived asyncio connections at once. > I'm using Starlette/Uvicorn fo