PEP 642: Add notes on reference implementation status (#1686)

This commit is contained in:
Nick Coghlan 2020-10-26 21:36:21 +10:00 committed by GitHub
parent 5e04c595b4
commit 732d8ff3a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 5 deletions

View File

@ -11,7 +11,7 @@ Content-Type: text/x-rst
Requires: 634
Created: 26-Sep-2020
Python-Version: 3.10
Post-History: 25-Oct-2020
Post-History:
Resolution:
Abstract
@ -44,6 +44,10 @@ pattern syntax:
* The `_` identifier is no longer syntactically special (it is a normal capture
pattern, just as it is an ordinary assignment target)
Note: the reference implementation for this PEP is being built on the reference
implementation for PEP 634. Once the implementation reaches a usable state,
the PEP will be published to python-dev and discuss.python.org.
Relationship with other PEPs
============================
@ -628,6 +632,18 @@ In particular, if static analysers can't follow certain kinds of dynamic checks,
then they can limit the permitted expressions at analysis time, rather than the
compiler restricting them at compile time.
Reference Implementation
========================
A reference implementation for this PEP is being derived from Brandt Bucher's
reference implementation for PEP 634 [3_].
Relative to the text of this PEP, the draft reference implementation will
retain literal patterns as implemented for PEP 634 (as this PEP only removes
them as redundant given constraint patterns, it doesn't inherently conflict with
them). Value patterns, wildcard patterns, and mapping patterns are being updated
to follow this PEP rather than PEP 634.
Acknowledgments
===============
@ -649,6 +665,9 @@ References
.. [2] Declined pull request proposing to list this as a Rejected Idea in PEP 622
https://github.com/python/peps/pull/1564
.. [3] PEP 634 reference implementation
https://github.com/python/cpython/pull/22917
.. _Appendix A:
@ -665,10 +684,6 @@ Notation used beyond standard EBNF is as per PEP 534:
- ``SEP.RULE+`` is shorthand for ``RULE (SEP RULE)*``
- ``!RULE`` is a negative lookahead assertion
Note: this still needs a reference implementation to confirm that the proposed
grammar is correct (in particular, ensuring the new wildcard and
constraint pattern definitions aren't considered ambiguous by the parser)
::
match_stmt: "match" subject_expr ':' NEWLINE INDENT case_block+ DEDENT