diff options
Diffstat (limited to 'tests/basics/fun_calldblstar3.py')
-rw-r--r-- | tests/basics/fun_calldblstar3.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/basics/fun_calldblstar3.py b/tests/basics/fun_calldblstar3.py new file mode 100644 index 0000000000..4367e68df7 --- /dev/null +++ b/tests/basics/fun_calldblstar3.py @@ -0,0 +1,16 @@ +# test passing a user-defined mapping as the argument to ** + +def foo(**kw): + print(sorted(kw.items())) + +class Mapping: + def keys(self): + return ['a', 'b', 'c'] + + def __getitem__(self, key): + if key == 'a': + return 1 + else: + return 2 + +foo(**Mapping()) |