We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Stable formatting of calls with a long expression results in a wrap that reduces readability
Unformatted:
if True: ___ = dict( x="---", y="----------------------------------------------------------" if True else None, z="---", )
Formatted:
Adding parenthesis results in more readable code. Black's preview style does so.
if True: ___ = dict( x="---", y=( "----------------------------------------------------------" if True else None ), z="---", )
With a shorter line, Ruff retains parenthesis when the lines are collapsed:
if True: ___ = dict( x="---", y=("---------------------------------------------" if True else None), z="---", )
However, these parenthesis should be removed as they are superfluous.
Black's preview style will not remove these parenthesis for calls, but probably should.
Note Black's preview style will remove these parenthesis for dict literals, see #8437 but will not for list literals, see #8438
See also psf/black#620 psf/black#3440 psf/black#3510
The text was updated successfully, but these errors were encountered:
parenthesize_conditional_expressions
dummy_implementations
I merge this into #8438 because conditional expression should be parenthesized in call contexts (as far as I understand)
Sorry, something went wrong.
No branches or pull requests
Stable formatting of calls with a long expression results in a wrap that reduces readability
Unformatted:
Formatted:
Adding parenthesis results in more readable code. Black's preview style does so.
With a shorter line, Ruff retains parenthesis when the lines are collapsed:
However, these parenthesis should be removed as they are superfluous.
Black's preview style will not remove these parenthesis for calls, but probably should.
Note Black's preview style will remove these parenthesis for dict literals, see #8437 but will not for list literals, see #8438
See also psf/black#620 psf/black#3440 psf/black#3510
The text was updated successfully, but these errors were encountered: