PEP 635: Add reference to DLS paper

This commit is contained in:
Guido van Rossum 2020-10-20 10:30:43 -07:00
parent ee89115a63
commit 35bd60204b
1 changed files with 12 additions and 3 deletions

View File

@ -86,6 +86,9 @@ We believe that adding pattern matching to Python will enable Python
users to write cleaner, more readable code for examples like those
above, and many others.
For a more academic approach to this proposal, see [1]_.
Pattern Matching and OO
-----------------------
@ -310,8 +313,6 @@ each composite statement starts with an identifying keyword, ``case`` seemed to
be most in line with Python's style and traditions.
Match Semantics
~~~~~~~~~~~~~~~
@ -580,7 +581,6 @@ Python). Other use cases are better expressed using guards.
In the end, it was decided that this would make the syntax more complex
without adding a significant benefit. It can always be added later.
**Example** using the OR pattern::
def simplify(expr):
@ -1218,6 +1218,15 @@ Or you would combine these ideas to write ``Node(right=y)`` so as to require
an instance of ``Node`` but only extract the value of the `right` attribute.
References
==========
.. [1] Kohn et al., Dynamic Pattern Matching with Python
https://doi.org/10.1145/3426422.3426983
(Accepted by DLS 2020. The link will go live after Nov. 17;
a preview PDF can be obtained from the first author.)
Copyright
=========