diff --git a/jedi/api/helpers.py b/jedi/api/helpers.py index f6212499..c262d873 100644 --- a/jedi/api/helpers.py +++ b/jedi/api/helpers.py @@ -263,8 +263,13 @@ def _iter_arguments(nodes, position): stars_seen = 0 elif node.type in ('testlist', 'testlist_star_expr'): # testlist is Python 2 for n in node.children[::2]: + if n.type == 'star_expr': + stars_seen = 1 + n = n.children[1] yield stars_seen, remove_after_pos(n), False stars_seen = 0 + # The count of children is even if there's a comma at the end. + previous_node_yielded = bool(len(node.children) % 2) elif isinstance(node, tree.PythonLeaf) and node.value == ',': if not previous_node_yielded: yield stars_seen, '', False diff --git a/test/test_api/test_call_signatures.py b/test/test_api/test_call_signatures.py index 602e8c4f..dcd36a6e 100644 --- a/test/test_api/test_call_signatures.py +++ b/test/test_api/test_call_signatures.py @@ -478,7 +478,11 @@ _calls = [ # Error nodes (code4, 'i(1, [a,b', 1), (code4, 'i(1, [a,b=,', 2), - (code4, 'i(1, [a!b,', 2), + (code4, 'i(1, [a?b,', 2), + (code4, 'i(1, [a?b,*', 2), + (code4, 'i(?b,*r,c', 1), + (code4, 'i(?*', 0), + (code4, 'i(?**', 1), ]