# PEP 828: Supporting 'yield from' in asynchronous generators

**URL:** <https://discuss.python.org/t/pep-828-supporting-yield-from-in-asynchronous-generators/106459>\
**Category:** PEPs\
**Created:** [March 9, 2026, 5:53pm UTC](https://discuss.python.org/t/pep-828-supporting-yield-from-in-asynchronous-generators/106459 "2026-03-09T17:53:47Z")\
**Posts on this page:** 1\
**Showing post:** 54

<div class="post-metadata">

**Author:** ![encukou](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/encukou/32/2461_2.png) [@encukou](https://discuss.python.org/u/encukou)\
**Post date:** [May 25, 2026, 2:19pm UTC](https://discuss.python.org/t/pep-828-supporting-yield-from-in-asynchronous-generators/106459/54 "2026-05-25T14:19:03Z")

</div>

> [@ZeroIntensity](#):
>
> there’s a weird translation layer that doesn’t work well in practice. For example:
> 
> ```python
> async def agen():
> async with asyncio.timeout(1):
> yield from syncgen() # asyncio.TimeoutError can be injected into a *synchronous* generator!
> 
> ```

This is pretty much what I’d expect the `yield from` to do. The synchronous generator should deal with the exception in the same way it deals with any unknown exception.  
I’ll probably want synchronous delegation at some point (if the PEP is accepted).

> [@ZeroIntensity](#):
>
> Overloading `yield from` to mean delegation to async from async would mean that we couldn’t ever add synchronous delegation in the future, though some argue that it will never happen anyway.

A sync gen → async gen transformation should be doable in user space, so I’m fine with disallowing sync delegation this for now. But I’d like if the door was kept open here.

So, I’m for `async yield from`. It also plays well with [recent SC opinion](https://discuss.python.org/t/pep-806-mixed-sync-async-context-managers-with-precise-async-marking/103971/12):

> Today every line performing asynchronous work [uses] `async` or `await` […], which is a property readers and static analysis tools often rely on.

* * *

> [@willingc](#):
>
> In the days of autocomplete and snippets (‘ayf’ expanding to ‘async yield from’), I wouldn’t worry too much about shortening. Clarity and understanding are more important to usage and teaching.

I might need that if I’ll be writing `async yield from ensure_asyncgen(syncgen)` :‍)  
But I don’t agree with the general idea. Each special tool or setup that we take for granted makes the language harder to use.

---

_[View the full topic](https://discuss.python.org/t/pep-828-supporting-yield-from-in-asynchronous-generators/106459)._
