[Python-Dev] Re: Weird io.OpenWrapper hack to use a function as method

2021-04-01 Thread Inada Naoki
On Thu, Apr 1, 2021 at 11:52 AM Brett Cannon wrote: > > On Wed., Mar. 31, 2021, 18:56 Inada Naoki, wrote: >> >> Do we need _pyio at all? >> Does PyPy or any other Python implementation use it? > > https://www.python.org/dev/peps/pep-0399/ would suggest rolling back Python > support is something

[Python-Dev] Re: Request for comments on final version of PEP 653 (Precise Semantics for Pattern Matching)

2021-04-01 Thread Mark Shannon
On 31/03/2021 11:31 pm, Brandt Bucher wrote: Guido van Rossum wrote: On Wed, Mar 31, 2021 at 2:14 PM Brandt Bucher brandtbuc...@gmail.com wrote: (One change from my last email: it doesn't allow `__match_map__` / `__match_seq__` to be set to `False`... only `True`. This prevents some otherwis

[Python-Dev] Re: Request for comments on final version of PEP 653 (Precise Semantics for Pattern Matching)

2021-04-01 Thread Mark Shannon
Hi Guido, On 31/03/2021 9:53 pm, Guido van Rossum wrote: On Wed, Mar 31, 2021 at 12:08 PM Mark Shannon > wrote: [snip] Apart from that, I think the semantics are so similar once you've added __match_seq__/__match_map__  to PEP 634 that is hard to claim one

[Python-Dev] Re: Request for comments on final version of PEP 653 (Precise Semantics for Pattern Matching)

2021-04-01 Thread Guido van Rossum
On Thu, Apr 1, 2021 at 2:18 PM Mark Shannon wrote: > On 31/03/2021 9:53 pm, Guido van Rossum wrote: > > On Wed, Mar 31, 2021 at 12:08 PM Mark Shannon > > wrote: > > [snip] > > > Apart from that, I think the semantics are so similar once you've > added > > __match_s

[Python-Dev] Re: Request for comments on final version of PEP 653 (Precise Semantics for Pattern Matching)

2021-04-01 Thread Terry Reedy
On 4/1/2021 9:38 PM, Guido van Rossum wrote: On Thu, Apr 1, 2021 at 2:18 PM Mark Shannon > wrote: Almost all the changes come from requiring __match_args__ to be a tuple of unique strings. The current posted PEP does not say 'unique' and I agree with Guido that

[Python-Dev] Re: Request for comments on final version of PEP 653 (Precise Semantics for Pattern Matching)

2021-04-01 Thread Guido van Rossum
On Thu, Apr 1, 2021 at 8:01 PM Terry Reedy wrote: > On 4/1/2021 9:38 PM, Guido van Rossum wrote: > > > On Thu, Apr 1, 2021 at 2:18 PM Mark Shannon > > wrote: > > Almost all the changes come from requiring __match_args__ to be a > tuple > > of unique strings. > > Th

[Python-Dev] Re: Request for comments on final version of PEP 653 (Precise Semantics for Pattern Matching)

2021-04-01 Thread Terry Reedy
On 4/2/2021 12:02 AM, Guido van Rossum wrote: On Thu, Apr 1, 2021 at 8:01 PM Terry Reedy The current near-Python code does not have such a check. Again, I'm not sure what "the current near-Python code" refers to. From context it seems you are referring to the pseudo code in Mark's PEP

[Python-Dev] Re: Request for comments on final version of PEP 653 (Precise Semantics for Pattern Matching)

2021-04-01 Thread Brandt Bucher
Guido van Rossum wrote: > Well, now I have egg on my face, because the current implementation does > reject multiple occurrences of the same identifier in __match_args__. We > generate an error like "TypeError: C() got multiple sub-patterns for > attribute 'a'". However, I cannot find this uniqu