From 31b5f9e4b4d783aed4787f2308ccccb281e57123 Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Sat, 27 Mar 2021 17:09:57 +0000 Subject: [PATCH] PEP 653: Delete out-of-date note and correct tests in mapping pattern translations. --- pep-0653.rst | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pep-0653.rst b/pep-0653.rst index 5c1b72ded98..41c540a4816 100644 --- a/pep-0653.rst +++ b/pep-0653.rst @@ -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: @@ -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) @@ -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):