New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib2to3 fails on a trailing comma after **kwargs in a function signature #77245
Comments
Title says all. I have a patch. |
Ned, I'd like this to make into 3.6.5 if at all possible. |
Does it support a trailing comma after *args or name=value? |
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. |
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. |
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. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: