Message391438
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. |
|
Date |
User |
Action |
Args |
2021-04-20 14:01:31 | ncoghlan | set | recipients:
+ ncoghlan, pablogsal, brandtbucher |
2021-04-20 14:01:31 | ncoghlan | set | messageid: <1618927291.7.0.364722303685.issue43892@roundup.psfhosted.org> |
2021-04-20 14:01:31 | ncoghlan | link | issue43892 messages |
2021-04-20 14:01:31 | ncoghlan | create | |
|