diff --git a/jedi/evaluate/__init__.py b/jedi/evaluate/__init__.py index adc1d292..26f3e6a6 100644 --- a/jedi/evaluate/__init__.py +++ b/jedi/evaluate/__init__.py @@ -321,8 +321,15 @@ class Evaluator(object): return set([compiled.create(self, atom.eval())]) else: c = atom.children + if c[0].type == 'string': + # Will be one string. + types = self._eval_atom(c[0]) + for string in c[1:]: + right = self._eval_atom(string) + types = precedence.calculate(self, types, '+', right) + return types # Parentheses without commas are not tuples. - if c[0] == '(' and not len(c) == 2 \ + elif c[0] == '(' and not len(c) == 2 \ and not(tree.is_node(c[1], 'testlist_comp') and len(c[1].children) > 1): return self.eval_element(c[1]) diff --git a/test/completion/arrays.py b/test/completion/arrays.py index 1dc896e1..0eb4ca31 100644 --- a/test/completion/arrays.py +++ b/test/completion/arrays.py @@ -204,6 +204,8 @@ dic2['asdf'] dic2[r'asdf'] #? int() dic2[r'asdf'] +#? int() +dic2[r'as' 'd' u'f'] #? int() str() dic2['just_something']