From 4555b2970171de6067f359552efd3efc5ccacf06 Mon Sep 17 00:00:00 2001 From: David Halter Date: Wed, 11 Jul 2012 02:03:19 +0200 Subject: [PATCH] new decorator tests (nested) --- test/completion/decorators.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/test/completion/decorators.py b/test/completion/decorators.py index 183feb73..c1b0900d 100644 --- a/test/completion/decorators.py +++ b/test/completion/decorators.py @@ -47,6 +47,32 @@ exe = fu(list, set, 3, '', d='') #? str() exe[3][0] +# ----------------- +# multiple decorators +# ----------------- +def dec2(func): + def wrapper(first_arg, *args, **kwargs): + return func(first_arg, *args, **kwargs) + return wrapper + +@dec2 +@dec +def fu2(a, b, c, *args, **kwargs): + return a, b, c, args, kwargs + +exe = fu2(list, c=set, b=3, d='str') + +#? list() +exe[0] +#? int() +exe[1] +#? set +exe[2] + +#? str() +exe[4]['d'] + + # ----------------- # class decorators # -----------------