From bb72ecfa8a1b10318cc56c36d9289c367a81e87c Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 2 Apr 2014 20:42:18 +0200 Subject: [PATCH] docstring annotation types should be instantiated -> execute them, fixes #178 --- jedi/evaluate/docstrings.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jedi/evaluate/docstrings.py b/jedi/evaluate/docstrings.py index 929f2586..f2d8a299 100644 --- a/jedi/evaluate/docstrings.py +++ b/jedi/evaluate/docstrings.py @@ -15,6 +15,7 @@ annotations. """ import re +from itertools import chain from textwrap import dedent from jedi.evaluate.cache import memoize_default @@ -115,7 +116,8 @@ def _evaluate_for_statement_string(evaluator, string, module): # call. In that case it's the module of the function call. # stuffed with content from a function call. pseudo_cls.parent = module - return evaluator.eval_statement(stmt) + return chain.from_iterable(evaluator.execute(defn) + for defn in evaluator.eval_statement(stmt)) @memoize_default(None, evaluator_is_first_arg=True)