1
0
forked from VimPlug/jedi

Start fixing issues with for loops and += operations.

This commit is contained in:
Dave Halter
2014-11-12 14:54:52 +01:00
parent 13c2279fea
commit 408eee50dd
4 changed files with 27 additions and 16 deletions
+10 -1
View File
@@ -1204,7 +1204,7 @@ class Statement(Simple, DocstringMixin):
def get_defined_names(self):
return list(chain.from_iterable(_defined_names(self.children[i])
for i in range(0, len(self.children) - 2, 2)
if self.children[i + 1].value == '='))
if '=' in self.children[i + 1].value))
"""Get the names for the statement."""
@@ -1266,6 +1266,15 @@ class Statement(Simple, DocstringMixin):
as_name.start_pos, as_name.end_pos, self))
return dct
def first_operation(self):
"""
Returns `+=`, `=`, etc or None if there is no operation.
"""
try:
return self.children[1]
except IndexError:
return None
@property
def assignment_details(self):
"""