summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unpack_ex.py
diff options
context:
space:
mode:
authorBatuhan Taskaya <isidentical@gmail.com>2020-05-21 22:39:56 (GMT)
committerGitHub <noreply@github.com>2020-05-21 22:39:56 (GMT)
commitb8a65ec1d3d4660d0ee38a9765d98f5cdcabdef5 (patch)
treed34d214c00702aa047f96b35e91613a1fe892df5 /Lib/test/test_unpack_ex.py
parent72e0aa2fd2b9c6da2caa5a9ef54f6495fc2890b0 (diff)
downloadcpython-b8a65ec1d3d4660d0ee38a9765d98f5cdcabdef5.zip
cpython-b8a65ec1d3d4660d0ee38a9765d98f5cdcabdef5.tar.gz
cpython-b8a65ec1d3d4660d0ee38a9765d98f5cdcabdef5.tar.bz2
bpo-40715: Reject dict unpacking on dict comprehensions (GH-20292)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
Diffstat (limited to 'Lib/test/test_unpack_ex.py')
-rw-r--r--Lib/test/test_unpack_ex.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_unpack_ex.py b/Lib/test/test_unpack_ex.py
index 2f53457..fcc9382 100644
--- a/Lib/test/test_unpack_ex.py
+++ b/Lib/test/test_unpack_ex.py
@@ -158,6 +158,11 @@ List comprehension element unpacking
...
SyntaxError: iterable unpacking cannot be used in comprehension
+ >>> {**{} for a in [1]}
+ Traceback (most recent call last):
+ ...
+ SyntaxError: dict unpacking cannot be used in dict comprehension
+
# Pegen is better here.
# Generator expression in function arguments