After careful deliberation, the Python Steering Council is pleased to accept PEP 798 – Unpacking in Comprehensions.
We are accepting this PEP with one modification: we require that both synchronous and asynchronous generator expressions use explicit loops rather than yield from for unpacking operations.
The Steering Council believes that simplicity and consistency are paramount here. The delegation behaviour provided by yield from adds semantic complexity for advanced use cases involving .send(), .throw(), and .close() that are rarely relevant when writing comprehensions. We don’t believe that developers writing comprehensions should have to think about the differences between sync and async generator semantics or about generator delegation protocols. We firmly believe that the mental model should be as simple as possible and as symmetric as possible between all kinds of comprehensions. The straightforward semantics of explicit loops provide a uniform mental model that works the same way regardless of context, and also provides better parity with the function-like versions, such as itertools.chain.from_iterable. For the rare cases where someone actually needs delegation behaviour, the Steering Council believes they should use an explicit generator function with yield from rather than a comprehension.
Congratulations, and thank you for your excellent work on this PEP. We look forward to seeing this feature in Python 3.15!
— The Python Steering Council