forked from VimPlug/jedi
Start fixing issues with for loops and += operations.
This commit is contained in:
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user