1
0
forked from VimPlug/jedi

get rid of the evaluate_generator param

This commit is contained in:
Dave Halter
2014-07-30 16:36:27 +02:00
parent 565cfce2fe
commit cf63d20988
3 changed files with 29 additions and 26 deletions

View File

@@ -62,7 +62,10 @@ class Generator(use_metaclass(CachedMetaClass, pr.Base)):
def iter_content(self):
""" returns the content of __iter__ """
return self.func.py__call__(self._evaluator, self.var_args, True)
# Directly execute it, because with a normal call to py__call__ a
# Generator will be returned.
from jedi.evaluate.representation import FunctionExecution
return FunctionExecution(self._evaluator, self.func, self.var_args).get_return_types()
def get_index_types(self, index_array):
#debug.warning('Tried to get array access on a generator: %s', self)
@@ -285,6 +288,7 @@ def get_iterator_types(inputs):
except KeyError:
debug.warning('Instance has no __next__ function in %s.', it)
else:
# TODO this is not correct, __iter__ can return arbitrary input!
# Is a generator.
result += it.iter_content()
return result