1
0
forked from VimPlug/jedi

Merge branch 'master' into python3

This commit is contained in:
Dave Halter
2020-07-17 16:07:47 +02:00
13 changed files with 171 additions and 49 deletions

View File

@@ -201,7 +201,7 @@ class MethodValue(FunctionValue):
class BaseFunctionExecutionContext(ValueContext, TreeContextMixin):
def _infer_annotations(self):
def infer_annotations(self):
raise NotImplementedError
@inference_state_method_cache(default=NO_VALUES)
@@ -215,7 +215,7 @@ class BaseFunctionExecutionContext(ValueContext, TreeContextMixin):
value_set = NO_VALUES
returns = get_yield_exprs(self.inference_state, funcdef)
else:
value_set = self._infer_annotations()
value_set = self.infer_annotations()
if value_set:
# If there are annotations, prefer them over anything else.
# This will make it faster.
@@ -367,7 +367,7 @@ class FunctionExecutionContext(BaseFunctionExecutionContext):
arguments=self._arguments
)
def _infer_annotations(self):
def infer_annotations(self):
from jedi.inference.gradual.annotation import infer_return_types
return infer_return_types(self._value, self._arguments)
@@ -379,7 +379,7 @@ class FunctionExecutionContext(BaseFunctionExecutionContext):
class AnonymousFunctionExecution(BaseFunctionExecutionContext):
def _infer_annotations(self):
def infer_annotations(self):
# I don't think inferring anonymous executions is a big thing.
# Anonymous contexts are mostly there for the user to work in. ~ dave
return NO_VALUES