Closed
Description
When working with async
generators, it is often advised, using something like aclosing
or trio_async_generator
to implement a pattern like:
async with my_generator() as values:
async for x in values:
...
which unnecessarily creates two nested blocks in a relatively non-ergonomic way. Instead, we could have a single syntax like
async with for x in my_generator():
...
that compiles to the code above.