Added issue: iterable unpacking cannot be used in comprehension

This commit is contained in:
Dave Halter
2017-07-23 23:22:05 +02:00
parent 33769c6243
commit 915b00dab7
2 changed files with 5 additions and 0 deletions

View File

@@ -136,6 +136,10 @@ class ErrorFinder(Normalizer):
if node.parent.type not in _STAR_EXPR_PARENTS:
message = "starred assignment target must be in a list or tuple"
self._add_syntax_error(message, node)
if node.parent.type == 'testlist_comp':
# [*[] for a in [1]]
message = "iterable unpacking cannot be used in comprehension"
self._add_syntax_error(message, node)
elif node.type == 'comp_for':
if node.children[0] == 'async' \
and not self._context.is_async_funcdef():