From 606871eb62f59ddfcaf9f7db496111e922dae2ce Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 30 Apr 2017 01:45:59 +0200 Subject: [PATCH] returns -> iter_return_stmts --- jedi/evaluate/representation.py | 2 +- jedi/parser/python/tree.py | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/jedi/evaluate/representation.py b/jedi/evaluate/representation.py index 824ff958..d0a19fd6 100644 --- a/jedi/evaluate/representation.py +++ b/jedi/evaluate/representation.py @@ -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)) diff --git a/jedi/parser/python/tree.py b/jedi/parser/python/tree.py index a31a0330..564f4fc0 100644 --- a/jedi/parser/python/tree.py +++ b/jedi/parser/python/tree.py @@ -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)