PEP 635: Add reference to DLS paper
This commit is contained in:
parent
ee89115a63
commit
35bd60204b
15
pep-0635.rst
15
pep-0635.rst
|
@ -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
|
users to write cleaner, more readable code for examples like those
|
||||||
above, and many others.
|
above, and many others.
|
||||||
|
|
||||||
|
For a more academic approach to this proposal, see [1]_.
|
||||||
|
|
||||||
|
|
||||||
Pattern Matching and OO
|
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.
|
be most in line with Python's style and traditions.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Match Semantics
|
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
|
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.
|
without adding a significant benefit. It can always be added later.
|
||||||
|
|
||||||
|
|
||||||
**Example** using the OR pattern::
|
**Example** using the OR pattern::
|
||||||
|
|
||||||
def simplify(expr):
|
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.
|
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
|
Copyright
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue