From 33ad6d2b6ff20b27fce4f4dfac9cdd42e820f61f Mon Sep 17 00:00:00 2001 From: David Halter Date: Mon, 7 May 2012 23:10:00 +0200 Subject: [PATCH] function calls with key arguments work now --- evaluate.py | 2 +- parsetest.py | 4 ++-- test/completion/functions.py | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/evaluate.py b/evaluate.py index 3891e9f2..29a3fbbb 100644 --- a/evaluate.py +++ b/evaluate.py @@ -132,7 +132,7 @@ class Executable(object): print '\n\nlala', key, value while key: try: - key_param = param_dict[key] + key_param = param_dict[str(key)] except KeyError: non_matching_keys.append((key, value)) else: diff --git a/parsetest.py b/parsetest.py index d9d3bfc4..a894d1c2 100644 --- a/parsetest.py +++ b/parsetest.py @@ -170,11 +170,11 @@ test = [1,2] def args_func(arg1, arg2=1, *args, **kwargs): return arg1, arg2, args, kwargs -exe = args_func(1,"") +exe = args_func(arg2=1,arg1=set) args_func() #1,"", a=list)[0]. args_func(arg1=0, *test + [3], *[4,5], **{'a': 'b'}). -exe[3]. +exe[0]. diff --git a/test/completion/functions.py b/test/completion/functions.py index 7736a801..a272453a 100644 --- a/test/completion/functions.py +++ b/test/completion/functions.py @@ -54,6 +54,21 @@ variable_rename(list())(). #? [] variable_rename(1)(). +# ----------------- +# double execution +# ----------------- + +def func(a=1, b=''): + return a, b + +exe = func(b=list, a=tuple) +#? [] +exe[0].real +#? ['index'] +exe[0].index + +#? ['append'] +exe[1].append # ----------------- # closures # -----------------