1
0
forked from VimPlug/jedi

Make the some names more concise in the parser tree.

This commit is contained in:
Dave Halter
2017-04-10 09:44:08 +02:00
parent 769cc80d6b
commit 218e715553
5 changed files with 21 additions and 16 deletions

View File

@@ -58,3 +58,13 @@ def get_comp_fors(comp_for):
elif not last.type == 'comp_if':
break
last = last.children[-1]
def for_stmt_defines_one_name(for_stmt):
"""
Returns True if only one name is returned: ``for x in y``.
Returns False if the for loop is more complicated: ``for x, z in y``.
:returns: bool
"""
return for_stmt.children[1].type == 'name'