Skip to content

Commit

Permalink
PEP 653: Delete out-of-date note and correct tests in mapping pattern…
Browse files Browse the repository at this point in the history
… translations. (#1895)
  • Loading branch information
markshannon authored Mar 27, 2021
1 parent 3686181 commit 59b39a6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pep-0653.rst
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ translates to::

if $kind & MATCH_MAPPING == 0:
FAIL
if $value.keys() != $KEYWORD_PATTERNS.keys():
if not $value.keys() >= $KEYWORD_PATTERNS.keys():
FAIL
# $KEYWORD_PATTERNS is a meta-variable mapping names to variables.
for $KEYWORD in $KEYWORD_PATTERNS:
Expand All @@ -283,7 +283,7 @@ translates to::

if $kind & MATCH_MAPPING == 0:
FAIL
if $value.keys() not >= $KEYWORD_PATTERNS.keys():
if not $value.keys() >= $KEYWORD_PATTERNS.keys():
FAIL:
# $KEYWORD_PATTERNS is a meta-variable mapping names to variables.
$tmp = dict($value)
Expand Down Expand Up @@ -347,11 +347,6 @@ translates to::

Example: [6]_

.. note::

``__match_args__`` is not checked when matching positional-only class patterns,
this allows classes to match only positional-only patterns by leaving ``__match_args__`` set to the default value of ``None``.

Class patterns with all keyword patterns::

case ClsName($KEYWORD_PATTERNS):
Expand Down

0 comments on commit 59b39a6

Please sign in to comment.