diff --git a/parsetest.py b/parsetest.py index 4f5d7533..9ef824d6 100644 --- a/parsetest.py +++ b/parsetest.py @@ -168,13 +168,13 @@ class C(object): def c_a(self): self.c_b = 1 +test = [1,2] +def args_func(arg1, *args, **kwargs): + return (arg1, args) -def args_func(arg1=0, *args, **kwargs): - return arg1 - return args - -#? ['real'] +exe = args_func(list,"", 3) args_func(1,"", a=list)[0]. -args_func().; C(). +args_func(arg1=0, *test + [3], *[4,5], **{'a': 'b'}). +exe[1]. diff --git a/test/completion/arrays.py b/test/completion/arrays.py index 2aedddf8..4cd7f0fd 100644 --- a/test/completion/arrays.py +++ b/test/completion/arrays.py @@ -116,3 +116,9 @@ f1. #? [] g1. +# ----------------- +# dicts +# ----------------- +dic2 = {'asdf': 3} +#? ['real'] +dic2['asdf'].real diff --git a/test/completion/functions.py b/test/completion/functions.py index cb37d9df..b92c1e95 100644 --- a/test/completion/functions.py +++ b/test/completion/functions.py @@ -69,11 +69,47 @@ def a(): l.real # ----------------- -# *args / ** kwargs +# *args # ----------------- def args_func(*args): return args +exe = args_func(1, "") #? ['real'] -args_func(1)[0].real +exe[0].real +#? [] +exe[0].upper + +#? [] +exe[1].real +#? ['upper'] +exe[1].upper + + +def args_func(arg1, *args): + return arg1, args + +exe = args_func(1, "", list) +#? ['real'] +exe[0].real +#? [] +exe[0].upper + +#? [] +exe[1].real +#? ['index'] +exe[1].index + +#? [] +exe[1][1].upper +#? ['append'] +exe[1][1].append + +# ----------------- +# ** kwargs +# ----------------- + +# ----------------- +# *args / ** kwargs +# -----------------