Unexpected node listed in Call.keywords
This is about the Call node. One of its fields is keywords, and another is kwargs. The former, according to the doc (and intuitively as well), is expected to list the keyword-based arguments; the latter, any unpacking argument.
Now, consider this function:
def ggg(pos_param, **kwargs):
pass
And the calls 1 and 2:
ggg(123, some_param='actualarg', another_param=456) # 1
ddd = {'whatever': 'sss', 'other_param': 9.99}
ggg(456, **ddd) # 2
For call 1, I get an empty node.kwargs and 2 Keyword elements in the list of node.keywords. I find this expected.
For call 2, I get on Keyword element in node.kwargs and the same element in node.keywords. I find this unexpected in 2 ways:
- first,
dddshouldn't be innode.keywords(since it isn't itself a keyword argument), only innode.kwargs; - second,
dddshouldn't be aKeywordobject, but an unpacking expression.
NOTE: There was a change from Python 3.4 to 3.5 in this area; maybe I should rely just on Keyword…
Thanks for the report.