This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients brandtbucher, ncoghlan, pablogsal
Date 2021-04-20.14:01:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1618927291.7.0.364722303685.issue43892@roundup.psfhosted.org>
In-reply-to
Content
It's specifically the definition of "match_case" in the AST that is affected:

match_case = (pattern pattern, expr? guard, stmt* body)

    pattern = MatchAlways
         | MatchValue(expr value)
         | MatchConstant(constant value)
         | MatchSequence(pattern* patterns)
         | MatchMapping(expr* keys, pattern* patterns)
         | MatchClass(expr cls, pattern* patterns, identifier* extra_attrs, pattern* extra_patterns)

         | MatchRestOfSequence(identifier? target)
         -- A NULL entry in the MatchMapping key list handles capturing extra mapping keys

         | MatchAs(pattern? pattern, identifier target)
         | MatchOr(pattern* patterns)
          attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset)

Relative to the PEP 642 AST, the notion of a "matchop" is gone - MatchValue always compares by equality, and there's a MatchConstant node for the identity comparisons against None, True, and False.

The grammar, code generator, AST validator, and unparser are then updated to produce or consume the new AST nodes.
History
Date User Action Args
2021-04-20 14:01:31ncoghlansetrecipients: + ncoghlan, pablogsal, brandtbucher
2021-04-20 14:01:31ncoghlansetmessageid: <1618927291.7.0.364722303685.issue43892@roundup.psfhosted.org>
2021-04-20 14:01:31ncoghlanlinkissue43892 messages
2021-04-20 14:01:31ncoghlancreate