function arguments parse

This commit is contained in:
Yuyao Huang
2024-04-22 15:52:10 +08:00
parent a177e32624
commit 0281d68cb4
6 changed files with 105 additions and 42 deletions
+26
View File
@@ -34,3 +34,29 @@ def test_return():
2 : a + 1
"""
''')
def test_args():
@Commentor("<return>")
def target(a, d=1, *b, c, k=1):
return a + k
asserteq_or_print(target(1, 2, 3, 4, c=5, k=2), '''
def target(a, d=1, *b, c, k=1):
"""
1 : a
2 : d
(3, 4) : b
5 : c
2 : k
"""
return a + k
"""
1 : a
2 : k
3 : a + k
"""
''')