mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
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:
parent
72e0aa2fd2
commit
b8a65ec1d3
3 changed files with 308 additions and 208 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue