mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
returns -> iter_return_stmts
This commit is contained in:
@@ -321,7 +321,7 @@ class FunctionExecutionContext(context.TreeContext):
|
||||
types = set()
|
||||
returns = funcdef.yields
|
||||
else:
|
||||
returns = funcdef.returns
|
||||
returns = funcdef.iter_return_stmts()
|
||||
types = set(docstrings.infer_return_types(self.function_context))
|
||||
types |= set(pep0484.infer_return_types(self.function_context))
|
||||
|
||||
|
||||
@@ -239,11 +239,8 @@ class Scope(PythonBaseNode, DocstringMixin):
|
||||
def __init__(self, children):
|
||||
super(Scope, self).__init__(children)
|
||||
|
||||
@property
|
||||
def returns(self):
|
||||
# Needed here for fast_parser, because the fast_parser splits and
|
||||
# returns will be in "normal" modules.
|
||||
return list(self._search_in_scope(ReturnStmt))
|
||||
def iter_return_stmts(self):
|
||||
return self._search_in_scope(ReturnStmt)
|
||||
|
||||
def iter_funcdefs(self):
|
||||
return self._search_in_scope(Function)
|
||||
|
||||
Reference in New Issue
Block a user