File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -2686,6 +2686,13 @@ def f(x: *b)
26862686 >>> f(x = 5, *:)
26872687 Traceback (most recent call last):
26882688 SyntaxError: Invalid star expression
2689+
2690+ Invalid assignment expressions with parenthesized targets:
2691+
2692+ >>> ((a) := 1)
2693+ Traceback (most recent call last):
2694+ ...
2695+ SyntaxError: cannot parenthesize target name in assignment expression
26892696"""
26902697
26912698import re
@@ -2852,11 +2859,6 @@ def test_assign_del(self):
28522859 # report "cannot delete name"
28532860 self ._check_error ("del a += b" , "invalid syntax" )
28542861
2855- def test_parenthesized_named_expression_target (self ):
2856- self ._check_error (
2857- "((a) := 1)" ,
2858- "cannot parenthesize target name in assignment expression" )
2859-
28602862 def test_global_param_err_first (self ):
28612863 source = """if 1:
28622864 def error(a):
You can’t perform that action at this time.
0 commit comments