diff options
| author | Damien George | 2016-04-21 16:51:36 +0100 |
|---|---|---|
| committer | Damien George | 2016-04-21 16:51:36 +0100 |
| commit | fea40ad46815cb372312f8ae223efcb3b879dd0f (patch) | |
| tree | 792d778536613667618b9544bc645215391e082d /tests/basics | |
| parent | d4f4cb6a240a96391cc8b8e61b0726c5084099fb (diff) | |
py: Fix bug passing a string as a keyword arg in a dict.
Addresses issue #1998.
Diffstat (limited to 'tests/basics')
| -rw-r--r-- | tests/basics/fun_calldblstar2.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/basics/fun_calldblstar2.py b/tests/basics/fun_calldblstar2.py new file mode 100644 index 000000000..cf982ef5b --- /dev/null +++ b/tests/basics/fun_calldblstar2.py @@ -0,0 +1,13 @@ +# test passing a string object as the key for a keyword argument + +# they key in this dict is a string object and is not interned +args = {'thisisaverylongargumentname': 123} + +# when this string is executed it will intern the keyword argument +exec("def foo(*,thisisaverylongargumentname=1):\n print(thisisaverylongargumentname)") + +# test default arg +foo() + +# the string from the dict should match the interned keyword argument +foo(**args) |
