1
0
forked from VimPlug/jedi

Refactor the docstring input.

This commit is contained in:
Dave Halter
2017-04-20 18:06:40 +02:00
parent fbde21166b
commit ea1905f121
3 changed files with 9 additions and 8 deletions

View File

@@ -207,12 +207,12 @@ def follow_param(module_context, param):
@memoize_default()
def infer_return_types(module_context, func):
def infer_return_types(function_context):
def search_return_in_docstr(code):
for p in DOCSTRING_RETURN_PATTERNS:
match = p.search(code)
if match:
return _strip_rst_role(match.group(1))
type_str = search_return_in_docstr(clean_scope_docstring(func))
return _evaluate_for_statement_string(module_context, type_str)
type_str = search_return_in_docstr(function_context.py__doc__())
return _evaluate_for_statement_string(function_context.get_root_context(), type_str)