msg313718 - (view) |
Author: Łukasz Langa (lukasz.langa) *  |
Date: 2018-03-13 02:50 |
Title says all. I have a patch. |
|
|
msg313719 - (view) |
Author: Łukasz Langa (lukasz.langa) *  |
Date: 2018-03-13 02:50 |
Ned, I'd like this to make into 3.6.5 if at all possible. |
|
|
msg313722 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2018-03-13 07:07 |
Does it support a trailing comma after *args or name=value? |
|
|
msg313723 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2018-03-13 07:26 |
I'm not sure that a trailing comma after **kwargs in a function signature should be allowed in Python grammar. Reasons for allowing it after other arguments don't work here since **kwargs is always a last item in a signature. But this ship perhaps is sailed. |
|
|
msg313724 - (view) |
Author: Łukasz Langa (lukasz.langa) *  |
Date: 2018-03-13 07:44 |
New changeset b51f5de71163f096d2d5229ede5379cdb284f651 by Łukasz Langa in branch 'master': bpo-33064: lib2to3: support trailing comma after *args and **kwargs (#6096) https://github.com/python/cpython/commit/b51f5de71163f096d2d5229ede5379cdb284f651 |
|
|
msg313725 - (view) |
Author: Łukasz Langa (lukasz.langa) *  |
Date: 2018-03-13 07:49 |
Yes, this ship has sailed with Python 3.6. I understand your logic and this is indeed why we didn't support this for a long time. However, people tend to grow muscle memory to add trailing commas and that was tripping them over for no real gain on our part. So this was added. The reason I found out about lib2to3 not following suit was that 3.6 users quickly started to put those trailing commas in and tools using lib2to3 were crashing on such files :) This proves it was worth it. |
|
|
msg313726 - (view) |
Author: Łukasz Langa (lukasz.langa) *  |
Date: 2018-03-13 07:52 |
Oh, and in terms of *calling* functions, now we can specify multiple unpacks, like: >>> f( ... **d, ... **e, ... ) so the extra comma for signatures simply makes it symmetrical in terms of appearance. |
|
|
msg313728 - (view) |
Author: Łukasz Langa (lukasz.langa) *  |
Date: 2018-03-13 08:08 |
New changeset b4c8871ca43d37be167ef5dbe9fb341922c04a9f by Łukasz Langa (Miss Islington (bot)) in branch '3.7': bpo-33064: lib2to3: support trailing comma after *args and **kwargs (GH-6096) (#6097) https://github.com/python/cpython/commit/b4c8871ca43d37be167ef5dbe9fb341922c04a9f |
|
|
msg313729 - (view) |
Author: Łukasz Langa (lukasz.langa) *  |
Date: 2018-03-13 08:32 |
New changeset 6a526f673878677032c02f7800ee13d4769f391a by Łukasz Langa (Miss Islington (bot)) in branch '3.6': bpo-33064: lib2to3: support trailing comma after *args and **kwargs (GH-6096) (#6098) https://github.com/python/cpython/commit/6a526f673878677032c02f7800ee13d4769f391a |
|
|