1
0
forked from VimPlug/jedi

Trying to use prefer type annotations if they are available

This commit is contained in:
Dave Halter
2018-08-05 00:36:11 +02:00
parent 403cf02c65
commit faba29a42b
4 changed files with 13 additions and 4 deletions

View File

@@ -150,8 +150,12 @@ class FunctionExecutionContext(TreeContext):
returns = get_yield_exprs(self.evaluator, funcdef)
else:
returns = funcdef.iter_return_stmts()
context_set = docstrings.infer_return_types(self.function_context)
context_set |= pep0484.infer_return_types(self.function_context)
context_set = pep0484.infer_return_types(self.function_context)
if context_set:
# If there are annotations, prefer them over anything else.
# This will make it faster.
return context_set
context_set |= docstrings.infer_return_types(self.function_context)
for r in returns:
check = flow_analysis.reachability_check(self, funcdef, r)