-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remove trailing comma in function definition on single line #725
Comments
Yes, that annoys me, too. |
Is this related to #1288? |
Do we have a pr for this already? I can create one if needed. |
is this now solved? @JelleZijlstra @ambv |
On master this has not been solved. I also can't see a PR for this issue. I think it would great if @felippemr could open one if he is still up for it? |
Closing as this issue doesn't make sense anymore after #826 and #1612 landed. The trailing comma will never be removed as it now has special meaning to Black. It is now a "magic" trailing comma and will cause the function parameter list to be exploded by Black. def f(x,):
pass will be formatted (by Black 20.8b1) to: def f(
x,
):
pass For the reader who has randomly stumbled across this issue and wants to know about the "magic trailing comma" feature, please read its documentation. |
I would have expected
to have its comma removed by Black, but that doesn't happen.
I think we should always remove the trailing comma if the function arguments fit on a single line.
(I ran into this when I removed a function's second argument and relied on Black to get rid of the trailing comma.)
The text was updated successfully, but these errors were encountered: