mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-15 16:36:44 +08:00
use execute method instead of Execution creators
This commit is contained in:
@@ -535,7 +535,7 @@ class Evaluator(object):
|
||||
call_path = call.generate_call_path()
|
||||
next(call_path, None) # the first one has been used already
|
||||
result += self.follow_path(call_path, r, call.parent,
|
||||
position=call.start_pos)
|
||||
position=call.start_pos)
|
||||
elif isinstance(call, pr.ListComprehension):
|
||||
loop = evaluate_list_comprehension(call)
|
||||
# Caveat: parents are being changed, but this doesn't matter,
|
||||
|
||||
@@ -135,7 +135,7 @@ class Instance(use_metaclass(CachedMetaClass, Executable)):
|
||||
|
||||
def execute_subscope_by_name(self, name, args=()):
|
||||
method = self.get_subscope_by_name(name)
|
||||
return Execution(self._evaluator, method, args).get_return_types()
|
||||
return self._evaluator.execute(method, args)
|
||||
|
||||
def get_descriptor_return(self, obj):
|
||||
""" Throws a KeyError if there's no method. """
|
||||
@@ -358,7 +358,7 @@ class Function(use_metaclass(CachedMetaClass, pr.IsScope)):
|
||||
old_func = InstanceElement(self._evaluator, instance, old_func)
|
||||
instance = None
|
||||
|
||||
wrappers = Execution(self._evaluator, decorator, (old_func,)).get_return_types()
|
||||
wrappers = self._evaluator.execute(decorator, (old_func,))
|
||||
if not len(wrappers):
|
||||
debug.warning('no wrappers found', self.base_func)
|
||||
return None
|
||||
@@ -809,7 +809,7 @@ class Generator(use_metaclass(CachedMetaClass, pr.Base, Iterable)):
|
||||
|
||||
def iter_content(self):
|
||||
""" returns the content of __iter__ """
|
||||
return Execution(self._evaluator, self.func, self.var_args).get_return_types(True)
|
||||
return self._evaluator.execute(self.func, self.var_args, True)
|
||||
|
||||
def get_index_types(self, index=None):
|
||||
debug.warning('Tried to get array access on a generator', self)
|
||||
|
||||
Reference in New Issue
Block a user