summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-11-15 15:39:37 (GMT)
committerGitHub <noreply@github.com>2017-11-15 15:39:37 (GMT)
commitddbce1378644f9d5ad0651e1c9035bd8c6502edc (patch)
tree73cd927d1c2b3bcaa6f5d6ad4bbf9d95927c5f3b /Lib
parentedad8eebeee3c99e324a7f1ac5073167c2b0b54d (diff)
downloadcpython-ddbce1378644f9d5ad0651e1c9035bd8c6502edc.zip
cpython-ddbce1378644f9d5ad0651e1c9035bd8c6502edc.tar.gz
cpython-ddbce1378644f9d5ad0651e1c9035bd8c6502edc.tar.bz2
bpo-32023: Disallow genexprs without parenthesis in class definitions. (#4400)
Diffstat (limited to 'Lib')
-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 c8cb705..e161f56d 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()))