mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
returns -> iter_return_stmts
This commit is contained in:
@@ -321,7 +321,7 @@ class FunctionExecutionContext(context.TreeContext):
|
|||||||
types = set()
|
types = set()
|
||||||
returns = funcdef.yields
|
returns = funcdef.yields
|
||||||
else:
|
else:
|
||||||
returns = funcdef.returns
|
returns = funcdef.iter_return_stmts()
|
||||||
types = set(docstrings.infer_return_types(self.function_context))
|
types = set(docstrings.infer_return_types(self.function_context))
|
||||||
types |= set(pep0484.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):
|
def __init__(self, children):
|
||||||
super(Scope, self).__init__(children)
|
super(Scope, self).__init__(children)
|
||||||
|
|
||||||
@property
|
def iter_return_stmts(self):
|
||||||
def returns(self):
|
return self._search_in_scope(ReturnStmt)
|
||||||
# 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_funcdefs(self):
|
def iter_funcdefs(self):
|
||||||
return self._search_in_scope(Function)
|
return self._search_in_scope(Function)
|
||||||
|
|||||||
Reference in New Issue
Block a user