Commit 477b213f authored by Christian Heimes's avatar Christian Heimes

Added two tests for f(*, **kw) syntax

parent 93266ab6
...@@ -58,6 +58,9 @@ exec_tests = [ ...@@ -58,6 +58,9 @@ exec_tests = [
"break", "break",
# Continue # Continue
"continue", "continue",
# kw only funcs
"def f(*, kw=1): pass",
"def f(*, **kw): pass",
] ]
# These are compiled through "single" # These are compiled through "single"
......
...@@ -144,6 +144,13 @@ class KeywordOnlyArgTestCase(unittest.TestCase): ...@@ -144,6 +144,13 @@ class KeywordOnlyArgTestCase(unittest.TestCase):
except TypeError: except TypeError:
pass pass
def test_doublestar_only(self):
def f(*, **kw):
return kw
self.assertEqual(f(), {})
self.assertEqual(f(k1=1, k2=2), {'k1' : 1, 'k2' : 2})
def test_main(): def test_main():
run_unittest(KeywordOnlyArgTestCase) run_unittest(KeywordOnlyArgTestCase)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment