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

2019-10-23 Thread Brandt Bucher
Brandt Bucher 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.

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

2019-10-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: I'd be +1 on this, but I'm worried about existing code relying on the functional use case from your example. If we are going to discourage it, I think we either have to: 1. Have DeprecationWarning that turns into a SyntaxError, or 2. Never truly remove it,

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

2019-10-22 Thread Brandt Bucher
New submission from Brandt Bucher : Calls of the form f(name=value, *args) are currently legal syntax. The resulting argument binding is awkward, and almost never does what you want/expect it to: >>> def f(x, y, z): ... print(x, y, z) ... >>> f(x=0, *(1, 2)) Traceback (most recent call