summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_scope.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_scope.py')
-rw-r--r--Lib/test/test_scope.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py
index 22f254a..ccb9016 100644
--- a/Lib/test/test_scope.py
+++ b/Lib/test/test_scope.py
@@ -166,6 +166,17 @@ class ScopeTests(unittest.TestCase):
self.assertEqual(t.method_and_var(), "method")
self.assertEqual(t.actual_global(), "global")
+ def testCellIsKwonlyArg(self):
+ # Issue 1409: Initialisation of a cell value,
+ # when it comes from a keyword-only parameter
+ def foo(*, a=17):
+ def bar():
+ return a + 5
+ return bar() + 3
+
+ self.assertEqual(foo(a=42), 50)
+ self.assertEqual(foo(), 25)
+
def testRecursion(self):
def f(x):