Closed evhub closed 1 year ago
When working with async generators, it is often advised, using something like aclosing or trio_async_generator to implement a pattern like:
async
aclosing
trio_async_generator
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.
When working with
async
generators, it is often advised, using something likeaclosing
ortrio_async_generator
to implement a pattern like:which unnecessarily creates two nested blocks in a relatively non-ergonomic way. Instead, we could have a single syntax like
that compiles to the code above.