diff options
Diffstat (limited to 'Lib/test/test_syntax.py')
| -rw-r--r-- | Lib/test/test_syntax.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index 812a7df322..4657fd1c0d 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -733,6 +733,19 @@ SyntaxError: trailing comma not allowed without surrounding parentheses 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 |
