gh-123562: Improve SyntaxError message for case ... as a.b (#123563)

This commit is contained in:
sobolevn 2024-09-02 14:11:44 +03:00 committed by GitHub
parent c3ed775899
commit 23f159ae71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 59 additions and 10 deletions

View file

@ -3015,6 +3015,13 @@ class TestSyntaxErrors(unittest.TestCase):
pass
""")
def test_multiple_assignments_to_name_in_pattern_6(self):
self.assert_syntax_error("""
match ...:
case a as a + 1: # NAME and expression with no ()
pass
""")
def test_multiple_starred_names_in_sequence_pattern_0(self):
self.assert_syntax_error("""
match ...: