-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
formatterRelated to the formatterRelated to the formatterpreviewRelated to preview mode featuresRelated to preview mode features
Milestone
Description
Implement Black's same as improved_async_statements_handling as a preview style. This is the same as #8889 but for async context managers. Requires Py39+
async def func() -> (int):
return 0
@decorated
async def func() -> (int):
return 0
async for (item) in async_iter:
passFormatted as (already implemented in ruff)
async def func() -> int:
return 0
@decorated
async def func() -> int:
return 0
async for item in async_iter:
passand
async def func():
async with \
make_context_manager1() as cm1, \
make_context_manager2() as cm2, \
make_context_manager3() as cm3, \
make_context_manager4() as cm4 \
:
pass
async with some_function(
argument1, argument2, argument3="some_value"
) as some_cm, some_other_function(
argument1, argument2, argument3="some_value"
):
passgets formatted as
async def func():
async with (
make_context_manager1() as cm1,
make_context_manager2() as cm2,
make_context_manager3() as cm3,
make_context_manager4() as cm4,
):
pass
async with (
some_function(argument1, argument2, argument3="some_value") as some_cm,
some_other_function(argument1, argument2, argument3="some_value"),
):
passReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
formatterRelated to the formatterRelated to the formatterpreviewRelated to preview mode featuresRelated to preview mode features