mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
bpo-43897: Reject "_" captures and top-level MatchStar in the AST validator (GH-27432)
This commit is contained in:
parent
92b5dc780d
commit
8d0647485d
2 changed files with 33 additions and 21 deletions
|
@ -1627,7 +1627,11 @@ class ASTValidatorTests(unittest.TestCase):
|
|||
),
|
||||
ast.MatchOr(
|
||||
[pattern_1, pattern_x, ast.MatchSingleton('xxx')]
|
||||
)
|
||||
),
|
||||
ast.MatchAs(name="_"),
|
||||
ast.MatchStar(name="x"),
|
||||
ast.MatchSequence([ast.MatchStar("_")]),
|
||||
ast.MatchMapping([], [], rest="_"),
|
||||
]
|
||||
|
||||
def test_match_validation_pattern(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue