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>
This commit is contained in:
Batuhan Taskaya 2020-05-22 01:39:56 +03:00 committed by GitHub
parent 72e0aa2fd2
commit b8a65ec1d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 308 additions and 208 deletions

View file

@ -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