1
0
forked from VimPlug/jedi

add support for 'with-assignment' hints

This commit is contained in:
Claude
2016-02-15 17:52:21 +01:00
parent 3a1b2e7104
commit 641fb80773
4 changed files with 20 additions and 0 deletions
+4
View File
@@ -308,6 +308,10 @@ def _name_to_types(evaluator, name, scope):
types = pep0484.find_type_from_comment_hint_for(evaluator, typ, name)
if types:
return types
if typ.isinstance(tree.WithStmt):
types = pep0484.find_type_from_comment_hint_with(evaluator, typ, name)
if types:
return types
if typ.isinstance(tree.ForStmt, tree.CompFor):
container_types = evaluator.eval_element(typ.children[3])
for_types = iterable.py__iter__types(evaluator, container_types, typ.children[3])