bpo-40769: Allow extra surrounding parentheses for invalid annotated assignment rule (GH-20387)
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 812a7df..4657fd1 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -733,6 +733,19 @@
Traceback (most recent call last):
SyntaxError: trailing comma not allowed without surrounding parentheses
+>>> (): int
+Traceback (most recent call last):
+SyntaxError: only single target (not tuple) can be annotated
+>>> []: int
+Traceback (most recent call last):
+SyntaxError: only single target (not list) can be annotated
+>>> (()): int
+Traceback (most recent call last):
+SyntaxError: only single target (not tuple) can be annotated
+>>> ([]): int
+Traceback (most recent call last):
+SyntaxError: only single target (not list) can be annotated
+
Corner-cases that used to fail to raise the correct error:
>>> def f(*, x=lambda __debug__:0): pass