From 692b85cfb2e3d04fa080e0ca2541f63ce4db58ff Mon Sep 17 00:00:00 2001 From: David Halter Date: Tue, 14 Aug 2012 15:00:31 +0200 Subject: [PATCH] list.extend / set.update works now --- dynamic.py | 4 ++-- test/completion/dynamic.py | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dynamic.py b/dynamic.py index e302a840..684fed1a 100644 --- a/dynamic.py +++ b/dynamic.py @@ -144,8 +144,8 @@ def _check_array_additions(compare_array, module, is_list): else: result += evaluate.follow_call_list([second_param]) elif add_name in ['extend', 'update']: - # TODO needs extensive work, because this are iterables - result += evaluate.follow_call_list(params) + iterators = evaluate.follow_call_list(params) + result += evaluate.handle_iterators(iterators) return result search_names = ['append', 'extend', 'insert'] if is_list else \ diff --git a/test/completion/dynamic.py b/test/completion/dynamic.py index e3a5807b..082833f3 100644 --- a/test/completion/dynamic.py +++ b/test/completion/dynamic.py @@ -162,9 +162,14 @@ arr.extend([1,2,3]) arr.extend([]) arr.extend("") # should ignore -##? float() int() -arr[0] +#? float() int() +arr[100] +a = set(arr) +a.update(list(["", 1])) + +#? float() int() str() +list(a)[0] # ----------------- # set/list initialized as functions # -----------------