1
0
forked from VimPlug/jedi

add a Flow.previous attribute to be able to access the if flow from an else clause.

This commit is contained in:
Dave Halter
2014-08-05 11:17:18 +02:00
parent 54dce0e3b2
commit c44168f7ad
6 changed files with 29 additions and 9 deletions

View File

@@ -26,6 +26,7 @@ from jedi.evaluate import iterable
from jedi.evaluate import docstrings
from jedi.evaluate import helpers
from jedi.evaluate import param
from jedi.evaluate import flow_analysis
class Executed(pr.IsScope):
@@ -471,8 +472,14 @@ class FunctionExecution(Executed):
types = list(docstrings.find_return_types(self._evaluator, func))
for r in self.returns:
if r is not None:
if r is None:
continue
check = flow_analysis.break_check(r.parent.parent)
if check is not flow_analysis.NOT_REACHABLE:
types += self._evaluator.eval_statement(r)
if check is flow_analysis.REACHABLE:
break
return types
@memoize_default(default=())