forked from VimPlug/jedi
fix issues with the previous commits (broken tests)
This commit is contained in:
@@ -322,7 +322,7 @@ def _gen_param_name_copy(func, var_args, param, keys=(), values=(), array_type=N
|
|||||||
|
|
||||||
# create an Array (-> needed for *args/**kwargs tuples/dicts)
|
# create an Array (-> needed for *args/**kwargs tuples/dicts)
|
||||||
arr = pr.Array(helpers.FakeSubModule, start_pos, array_type, parent)
|
arr = pr.Array(helpers.FakeSubModule, start_pos, array_type, parent)
|
||||||
arr.values = values
|
arr.values = list(values) # Arrays only work with list.
|
||||||
key_stmts = []
|
key_stmts = []
|
||||||
for key in keys:
|
for key in keys:
|
||||||
key_stmts.append(helpers.FakeStatement([key], start_pos))
|
key_stmts.append(helpers.FakeStatement([key], start_pos))
|
||||||
|
|||||||
@@ -233,13 +233,18 @@ class InstanceElement(use_metaclass(CachedMetaClass, pr.Base)):
|
|||||||
|
|
||||||
def expression_list(self):
|
def expression_list(self):
|
||||||
# Copy and modify the array.
|
# Copy and modify the array.
|
||||||
return [InstanceElement(self.instance._evaluator, self.instance, command, self.is_class_var)
|
return [InstanceElement(self._evaluator, self.instance, command, self.is_class_var)
|
||||||
if not isinstance(command, (pr.Operator, Token)) else command
|
if not isinstance(command, (pr.Operator, Token)) else command
|
||||||
for command in self.var.expression_list()]
|
for command in self.var.expression_list()]
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
for el in self.var.__iter__():
|
for el in self.var.__iter__():
|
||||||
yield InstanceElement(self.instance._evaluator, self.instance, el, self.is_class_var)
|
yield InstanceElement(self.instance._evaluator, self.instance, el,
|
||||||
|
self.is_class_var)
|
||||||
|
|
||||||
|
def __getitem__(self, index):
|
||||||
|
return InstanceElement(self._evaluator, self.instance, self.var[index],
|
||||||
|
self.is_class_var)
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
return getattr(self.var, name)
|
return getattr(self.var, name)
|
||||||
|
|||||||
Reference in New Issue
Block a user