1
0
forked from VimPlug/jedi

Move execute_evaluated to a helper function

This commit is contained in:
Dave Halter
2018-08-05 01:26:13 +02:00
parent faba29a42b
commit 7a48fdc5f6
10 changed files with 30 additions and 22 deletions

View File

@@ -237,3 +237,14 @@ def reraise_as_evaluator(*exception_classes):
except exception_classes as e:
new_exc_cls = globals()['Evaluator' + e.__class__.__name__]
raise new_exc_cls(e)
def execute_evaluated(context, *value_list):
"""
Execute a function with already executed arguments.
"""
# TODO move this out of here to the evaluator.
from jedi.evaluate.arguments import ValuesArguments
from jedi.evaluate.base_context import ContextSet
arguments = ValuesArguments([ContextSet(value) for value in value_list])
return context.evaluator.execute(context, arguments)