forked from VimPlug/jedi
find_return_types -> infer_return_types.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user