Make nesting of *args/**kwargs possible to understand.

This commit is contained in:
Dave Halter
2019-07-26 14:42:20 +02:00
parent ba160e72ab
commit 41dc5382fa
2 changed files with 12 additions and 3 deletions

View File

@@ -104,6 +104,11 @@ def test_tree_signature(Script, environment, code, expected):
('combined_lot_of_args(kw, simple4)', '*, b'),
('combined_lot_of_args(simple4, kw)', '*, b, c, **kwargs'),
('combined_redirect(combined_redirect(simple2, simple4), combined_redirect(kw, simple5))',
'x, /, *, y'),
('combined_redirect(combined_redirect(simple4, simple2), combined_redirect(simple5, kw))',
'a, b, x: int, /, *, a, b, c, **kwargs'),
]
)
def test_nested_signatures(Script, environment, combination, expected):
@@ -112,6 +117,7 @@ def test_nested_signatures(Script, environment, combination, expected):
def simple2(x): ...
def simple3(a, x: int): ...
def simple4(a, b, x: int): ...
def simple5(y): ...
def a(a, b, *args): ...
def kw(a, b, *, c, **kwargs): ...
def akw(a, b, *args, **kwargs): ...