forked from VimPlug/jedi
get rid of is_list_comp boolean in favor of a direct check of ListComprehensionFlow
This commit is contained in:
@@ -83,7 +83,6 @@ from jedi.evaluate import stdlib
|
||||
from jedi.evaluate import finder
|
||||
from jedi.evaluate import compiled
|
||||
from jedi.evaluate import precedence
|
||||
from jedi.evaluate import helpers
|
||||
|
||||
|
||||
class Evaluator(object):
|
||||
@@ -379,19 +378,8 @@ def _evaluate_list_comprehension(lc, parent=None):
|
||||
if isinstance(nested_lc, pr.ListComprehension):
|
||||
# is nested LC
|
||||
input = nested_lc.stmt
|
||||
loop = ListComprehensionFlow(lc, input, parent)
|
||||
loop = iterable.ListComprehensionFlow(lc, input, parent)
|
||||
|
||||
if isinstance(nested_lc, pr.ListComprehension):
|
||||
loop = _evaluate_list_comprehension(nested_lc, loop)
|
||||
return loop
|
||||
|
||||
|
||||
class ListComprehensionFlow(pr.ForFlow):
|
||||
"""Fake implementation to pretend being a ForFlow."""
|
||||
def __init__(self, list_comprehension, input, parent):
|
||||
lc = list_comprehension
|
||||
sup = super(ListComprehensionFlow, self)
|
||||
sup.__init__(helpers.FakeSubModule, [input], lc.parent.start_pos,
|
||||
lc.middle, True)
|
||||
self.parent = parent or lc.get_parent_until(pr.IsScope)
|
||||
self.list_comprehension = list_comprehension
|
||||
|
||||
Reference in New Issue
Block a user