diff --git a/jedi/api.py b/jedi/api.py index 5c16a099..1cb82c2b 100644 --- a/jedi/api.py +++ b/jedi/api.py @@ -468,7 +468,7 @@ class Script(object): c = user_stmt.get_commands()[0] if not isinstance(c, unicode) and self._pos < c.start_pos: # the search_name might be before `=` - definitions = [v for v in user_stmt.set_vars + definitions = [v for v in user_stmt.get_set_vars() if unicode(v.names[-1]) == search_name] if not isinstance(user_stmt, pr.Import): # import case is looked at with add_import_name option diff --git a/jedi/parsing.py b/jedi/parsing.py index 9df6c9a6..f97e0ea2 100644 --- a/jedi/parsing.py +++ b/jedi/parsing.py @@ -405,7 +405,7 @@ class Parser(object): with common.ignored(IndexError, AttributeError): # If string literal is being parsed first_tok = stmt.token_list[0] - if (not stmt.set_vars + if (not stmt.get_set_vars() and not stmt.used_vars and len(stmt.token_list) == 1 and first_tok[0] == tokenize.STRING): diff --git a/jedi/parsing_representation.py b/jedi/parsing_representation.py index 7b77a21c..a8c684ef 100644 --- a/jedi/parsing_representation.py +++ b/jedi/parsing_representation.py @@ -819,10 +819,6 @@ class Statement(Simple): search_calls(calls) return self._set_vars + self.as_names - @property - def set_vars(self): - return self.get_set_vars() - def is_global(self): # first keyword of the first token is global -> must be a global return str(self.token_list[0]) == "global" diff --git a/jedi/refactoring.py b/jedi/refactoring.py index 73018454..6a3d96df 100644 --- a/jedi/refactoring.py +++ b/jedi/refactoring.py @@ -191,7 +191,7 @@ def inline(script): replace_str = '(%s)' % replace_str # if it's the only assignment, remove the statement - if len(stmt.set_vars) == 1: + if len(stmt.get_set_vars()) == 1: line = line[:stmt.start_pos[1]] + line[stmt.end_pos[1]:] dct = _rename(inlines, replace_str)