summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/closure_defargs.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basics/closure_defargs.py')
-rw-r--r--tests/basics/closure_defargs.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/basics/closure_defargs.py b/tests/basics/closure_defargs.py
new file mode 100644
index 0000000000..96b1092659
--- /dev/null
+++ b/tests/basics/closure_defargs.py
@@ -0,0 +1,11 @@
+# test closure with default args
+
+def f():
+ a = 1
+ def bar(b = 10, c = 20):
+ print(a + b + c)
+ bar()
+ bar(2)
+ bar(2, 3)
+
+print(f())