mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
Fix generator comprehensions issue when used as an argument.
This commit is contained in:
@@ -84,7 +84,14 @@ class Arguments(pr.Base):
|
||||
yield key, values
|
||||
else:
|
||||
if pr.is_node(el, 'argument'):
|
||||
named_args.append((el.children[0].value, (el.children[2],)))
|
||||
c = el.children
|
||||
if len(c) == 3: # Keyword argument.
|
||||
named_args.append((c[0].value, (c[2],)))
|
||||
else: # Generator comprehension.
|
||||
# Include the brackets with the parent.
|
||||
comp = iterable.GeneratorComprehension(
|
||||
self._evaluator, self.argument_node.parent)
|
||||
yield None, (iterable.AlreadyEvaluated([comp]),)
|
||||
elif isinstance(el, (list, tuple)):
|
||||
yield None, el
|
||||
else:
|
||||
|
||||
@@ -338,6 +338,11 @@ tuple((1,))[0]
|
||||
#? []
|
||||
list().__iterable
|
||||
|
||||
# With a list comprehension.
|
||||
for i in set(a for a in [1]):
|
||||
#? int()
|
||||
i
|
||||
|
||||
|
||||
# -----------------
|
||||
# Recursions
|
||||
|
||||
Reference in New Issue
Block a user