[issue38560] Allow iterable argument unpacking after a keyword argument?

Brandt Bucher report at bugs.python.org
Wed Oct 23 17:20:14 EDT 2019


Brandt Bucher <brandtbucher at gmail.com> added the comment:

I've found one occurrence of this in the CPython codebase, in test_ast.py. Basically it makes sure that the following expression parses and compiles correctly:

f(1,2,c=3,*d,**e)

I doubt that this is to protect against regressions in this specific syntax. More likely it's just trying to create as many of the different argument passing AST nodes as possible in one call (it's the only test for function calls with arguments). It can probably be slightly refactored:

f(1,2,*c,d=3,**e)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38560>
_______________________________________


More information about the Python-bugs-list mailing list