aboutsummaryrefslogtreecommitdiff
path: root/tests/basics
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics')
-rw-r--r--tests/basics/fun_calldblstar2.py13
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)