msg70449 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2008-07-31 01:16 |
functions with keyword-only arguments have this form: def f(x, *args, y): pass parameters can appear after the *arg, they are required to be passed by keyword. It would be more consistent to allow this function call: f(X, *ARGS, y=Y) This is invalid syntax, *ARGS is required to be at the end of the arguments, together with an eventual **KWARGS. This restriction should be lifted. See the use case in http://mail.python.org/pipermail/python-3000/2008-July/014437.html |
|
|
msg70451 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2008-07-31 01:30 |
Should this apply to 2.6 as well? See r65321, I find the last line easier to read when arguments are in this order. def grouper(n, iterable, fillvalue=None): args = [iter(iterable)] * n return izip_longest(*args, fillvalue=fillvalue) On the cons side, keyword-only arguments don't exist in 2.6, so the consistency with function definition syntax does not apply. |
|
|
msg70485 - (view) |
Author: Raymond Hettinger (rhettinger) *  |
Date: 2008-07-31 06:31 |
+1 for applying to 2.6. izip_longest() is a perfect example of where it's important. |
|
|
msg70499 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2008-07-31 13:13 |
Patches for both versions are attached. |
|
|
msg70502 - (view) |
Author: Benjamin Peterson (benjamin.peterson) *  |
Date: 2008-07-31 13:54 |
The patches look good to me. |
|
|
msg70510 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2008-07-31 14:38 |
I'll have a look at this in the next day or two. |
|
|
msg70597 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2008-08-01 21:47 |
I will not have internet access for the next week. Raymond, would you take care of this issue? |
|
|
msg71094 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2008-08-13 18:09 |
Another use case: upon reading A.Baxter's Porting to 3 talk, I realized, slightly generalizing from his example, that print(s.join(map(str,it))) == print(*it,sep=s) -- or would, except that it currently has to be written non-intuitively as print(sep=s,*it), which I might not have tried except for knowing about this issue. Given that many have problems with .join and that most uses are to produce immediate output not otherwise processed, I think having the replacement work in the way many would expect would be a win. So I hope this makes the next beta. |
|
|
msg71198 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2008-08-16 06:39 |
Ping! |
|
|
msg71293 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2008-08-17 22:10 |
Barry, is it still time for this to be included in 2.6b3? Guido already approved the idea: http://mail.python.org/pipermail/python-3000/2008-July/014506.html |
|
|
msg71471 - (view) |
Author: Barry A. Warsaw (barry) *  |
Date: 2008-08-19 19:31 |
Guido's approved it, so please go ahead and add it before beta 3. |
|
|
msg71473 - (view) |
Author: Benjamin Peterson (benjamin.peterson) *  |
Date: 2008-08-19 19:53 |
Applied for 2.6 in r65872. |
|
|
msg71481 - (view) |
Author: Benjamin Peterson (benjamin.peterson) *  |
Date: 2008-08-19 20:57 |
Done for py3k in r65877. |
|
|
msg71486 - (view) |
Author: Benjamin Peterson (benjamin.peterson) *  |
Date: 2008-08-19 21:26 |
Now test_compiler is breaking for us because the compiler package can't handle the change. |
|
|
msg72485 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2008-09-04 06:59 |
The compiler package was fixed some time ago with r65891 |
|
|
msg225968 - (view) |
Author: Martijn Pieters (mjpieters) * |
Date: 2014-08-27 10:53 |
The documentation change in this patch introduced a bug in the Call grammar: | "*" `expression` ["," "*" `expression`] ["," "**" `expression`] instead of |
"*" `expression` ["," `keyword_arguments`] ["," "**" `expression`] giving the impression that `*expression` is allowed twice. |
|
msg226009 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2014-08-28 04:07 |
New changeset 3ae399c6ecf6 by Benjamin Peterson in branch '2.7': correct call grammar error (#3473) http://hg.python.org/cpython/rev/3ae399c6ecf6 |
|
|