On Tue, 9 Feb 2021 08:56:02 +1000 Nick Coghlan firstname.lastname@example.org wrote:
After much deliberation, the Python Steering Council is happy to announce that we have chosen to accept PEP 634, and its companion PEPs 635 and 636, collectively known as the Pattern Matching PEPs. We acknowledge that Pattern Matching is an extensive change to Python and that reaching consensus across the entire community is close to impossible. Different people have reservations or concerns around different aspects of the semantics and the syntax (as does the Steering Council). In spite of this, after much deliberation, reviewing all conversations around these PEPs, as well as competing proposals and existing poll results, and after several in-person discussions with the PEP authors, we are confident that Pattern Matching as specified in PEP 634, et al, will be a great addition to the Python language.
Thank you for resolving this discussion - I'm sure it wasn't an easy decision.
Obviously I think we're going to find things to regret in the way name binding works in class and mapping patterns, but I also think using "_ as name" as an explanatory tool is likely to cover most of them.
I'll also consider submitting a PEP *adding* explicit patterns to the implicit ones, rather than proposing to replace them, so the handling of different kinds of bare expressions can be readily explained as syntactic shorthand for more explicit operations rather than the shorthand being the only available spelling.
Also, +100 for resubmitting on its own just the part of PEP642 which adds "== EXPR" and "is EXPR" syntax, to match by expression value (i.e. where PEP642 initially started from).
I won't do that until after helping with the review of the main PEP 634 implementation, though.