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
if True: with ( anyio.CancelScope(shield=True) if get_running_loop() else contextlib.nullcontext() ): pass if True: with ( anyio.CancelScope(shield=True) and B and [aaaaaaaa, bbbbbbbbbbbbb, cccccccccc, dddddddddddd, eeeeeeeeeeeee] ): pass
if True: with anyio.CancelScope( shield=True ) if get_running_loop() else contextlib.nullcontext(): pass if True: with anyio.CancelScope(shield=True) and B and [ aaaaaaaa, bbbbbbbbbbbbb, cccccccccc, dddddddddddd, eeeeeeeeeeeee, ]: pass
Ruff uses the maybe_parenthesize (can omit optional parentheses) layout where black seems not to.
maybe_parenthesize
I'm not sure if I agree with this choice because Black/Ruff use the maybe_parenthesize layout consistently in all other clause header positions.
The text was updated successfully, but these errors were encountered:
This is a bug -- we should be preserving the parentheses. We do the right thing with if statements:
if
if True: with ( anyio.CancelScope(shield=True) if get_running_loop() else contextlib.nullcontext() ): pass if True: if ( anyio.CancelScope(shield=True) if get_running_loop() else contextlib.nullcontext() ): pass
Sorry, something went wrong.
Not a blocker for the Beta, but we may fix it anyway this month.
Not totally trivial in part due to the as.
as
I believe this was closed by #7694.
MichaReiser
No branches or pull requests
Input
Black
Ruff
Expected
Ruff uses the
maybe_parenthesize
(can omit optional parentheses) layout where black seems not to.I'm not sure if I agree with this choice because Black/Ruff use the
maybe_parenthesize
layout consistently in all other clause header positions.The text was updated successfully, but these errors were encountered: