1
0
forked from VimPlug/jedi

find_return_types -> infer_return_types.

This commit is contained in:
Dave Halter
2017-04-20 09:56:16 +02:00
parent ac8ed62a77
commit fbde21166b
3 changed files with 4 additions and 4 deletions

View File

@@ -207,7 +207,7 @@ def follow_param(module_context, param):
@memoize_default()
def find_return_types(module_context, func):
def infer_return_types(module_context, func):
def search_return_in_docstr(code):
for p in DOCSTRING_RETURN_PATTERNS:
match = p.search(code)

View File

@@ -99,7 +99,7 @@ def py__annotations__(funcdef):
@memoize_default()
def find_return_types(context, func):
def infer_return_types(context, func):
annotation = py__annotations__(func).get("return", None)
return _evaluate_for_annotation(context, annotation)

View File

@@ -330,8 +330,8 @@ class FunctionExecutionContext(context.TreeContext):
returns = funcdef.yields
else:
returns = funcdef.returns
types = set(docstrings.find_return_types(self.get_root_context(), funcdef))
types |= set(pep0484.find_return_types(self.get_root_context(), funcdef))
types = set(docstrings.infer_return_types(self.get_root_context(), funcdef))
types |= set(pep0484.infer_return_types(self.get_root_context(), funcdef))
for r in returns:
check = flow_analysis.reachability_check(self, funcdef, r)