Prefer preserving WithItem parentheses (#7694)

This commit is contained in:
Micha Reiser
2023-09-28 15:42:40 +02:00
committed by GitHub
parent 1e173f7909
commit f53c410ff8
3 changed files with 83 additions and 4 deletions

View File

@@ -288,3 +288,22 @@ with (
with (foo() as bar, baz() as bop):
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
if True:
with anyio.CancelScope(shield=True) if get_running_loop() else contextlib.nullcontext():
pass