summaryrefslogtreecommitdiff
path: root/tests/basics/fun_kwonly.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-12-12 13:42:51 +0000
committerDamien George <damien.p.george@gmail.com>2015-12-12 13:42:51 +0000
commit29e9db0c587145a8823227635734924896cdc4d1 (patch)
tree5154dbd6aefce46f4ea015a2891efe95d46383f7 /tests/basics/fun_kwonly.py
parentbb7f5b55010a3957bad30fbb505664e385b290b6 (diff)
py: Fix compiler to handle lambdas used as default arguments.
Addresses issue #1709.
Diffstat (limited to 'tests/basics/fun_kwonly.py')
-rw-r--r--tests/basics/fun_kwonly.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/basics/fun_kwonly.py b/tests/basics/fun_kwonly.py
index bdff3a821..7694c8ddc 100644
--- a/tests/basics/fun_kwonly.py
+++ b/tests/basics/fun_kwonly.py
@@ -57,3 +57,10 @@ def f(a, *b, c):
f(1, c=2)
f(1, 2, c=3)
f(a=1, c=3)
+
+# lambda as kw-only arg (exposes nested behaviour in compiler)
+def f(*, x=lambda:1):
+ return x()
+print(f())
+print(f(x=f))
+print(f(x=lambda:2))