diff --git a/jedi/dynamic.py b/jedi/dynamic.py index 23876c84..fdc4a136 100644 --- a/jedi/dynamic.py +++ b/jedi/dynamic.py @@ -239,8 +239,9 @@ def _check_array_additions(compare_array, module, is_list): for c in calls: call_path = list(c.generate_call_path()) separate_index = call_path.index(add_name) - if not len(call_path) > separate_index + 1: + if add_name == call_path[-1] or separate_index == 0: # this means that there is no execution -> [].append + # or the keyword is at the start -> append() continue backtrack_path = iter(call_path[:separate_index]) diff --git a/test/completion/dynamic.py b/test/completion/dynamic.py index 407273b9..e1be4017 100644 --- a/test/completion/dynamic.py +++ b/test/completion/dynamic.py @@ -383,6 +383,8 @@ first(1.0)[0] def third(): b = [] + b.extend + extend() b.extend(first()) return list(b) #?