summaryrefslogtreecommitdiff
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-11-15 17:39:37 +0200
committerGitHub <noreply@github.com>2017-11-15 17:39:37 +0200
commitddbce1378644f9d5ad0651e1c9035bd8c6502edc (patch)
tree73cd927d1c2b3bcaa6f5d6ad4bbf9d95927c5f3b /Lib/test/test_syntax.py
parentedad8eebeee3c99e324a7f1ac5073167c2b0b54d (diff)
downloadcpython-git-ddbce1378644f9d5ad0651e1c9035bd8c6502edc.tar.gz
bpo-32023: Disallow genexprs without parenthesis in class definitions. (#4400)
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index c8cb7055c0..e161f56d30 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -153,6 +153,10 @@ Traceback (most recent call last):
SyntaxError: Generator expression must be parenthesized
>>> f((x for x in L), 1)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> class C(x for x in L):
+... pass
+Traceback (most recent call last):
+SyntaxError: invalid syntax
>>> def g(*args, **kwargs):
... print(args, sorted(kwargs.items()))