summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-05-21 22:58:16 (GMT)
committerGitHub <noreply@github.com>2020-05-21 22:58:16 (GMT)
commitd00aaf306aecf2d4bf9c9aebc9bc35ed03b1a7d0 (patch)
tree143766070ad9b4ed5fb4c7aaaa23d18b6b8187ad /Lib
parent7178b1bb68aa14c35338b7b31ea5d1cbf76fb6a4 (diff)
downloadcpython-d00aaf306aecf2d4bf9c9aebc9bc35ed03b1a7d0.zip
cpython-d00aaf306aecf2d4bf9c9aebc9bc35ed03b1a7d0.tar.gz
cpython-d00aaf306aecf2d4bf9c9aebc9bc35ed03b1a7d0.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> (cherry picked from commit b8a65ec1d3d4660d0ee38a9765d98f5cdcabdef5) Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
Diffstat (limited to 'Lib')
-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