diff --git a/README.rst b/README.rst index 254bc8e9..86e9ae3e 100644 --- a/README.rst +++ b/README.rst @@ -65,7 +65,6 @@ Jedi supports many of the widely used Python features: However, it does not yet support (and probably will in future versions, because they are on my todo list): -- operation support -> [3]\*3 etc. - manipulations of instances outside the instance variables, without using functions - assert diff --git a/jedi/evaluate.py b/jedi/evaluate.py index b14a09f6..c0502ba4 100644 --- a/jedi/evaluate.py +++ b/jedi/evaluate.py @@ -1401,6 +1401,12 @@ def follow_call_list(call_list): pass continue result += follow_call(call) + elif call == '*': + if [r for r in result if isinstance(r, Array) + or isinstance(r, Instance) + and str(r.name) == 'str']: + # if it is an iterable, ignore * operations + next(calls_iterator) return set(result) diff --git a/test/completion/arrays.py b/test/completion/arrays.py index f0858d2e..9c8a143d 100644 --- a/test/completion/arrays.py +++ b/test/completion/arrays.py @@ -31,6 +31,21 @@ b[8-7] b[8:] +# ----------------- +# iterable multiplication +# ----------------- +a = ['']*2 +#? list() +a + +a = 2*2 +#? int() +a + +a = "a"*3 +#? str() +a + # ----------------- # tuple assignments # -----------------