@@ -8,6 +8,7 @@ Type: Standards Track
88Created: 19-Jul-2025
99Python-Version: 3.15
1010Post-History: `16-Oct-2021 <https://mail.python.org/archives/list/python-ideas@python.org/thread/7G732VMDWCRMWM4PKRG6ZMUKH7SUC7SH/ >`__, `22-Jun-2025 <https://discuss.python.org/t/pre-pep-unpacking-in-comprehensions/96362 >`__, `19-Jul-2025 <https://discuss.python.org/t/pep-798-unpacking-in-comprehensions/99435 >`__
11+ Resolution: `03-Nov-2025 <https://discuss.python.org/t/pep-798-unpacking-in-comprehensions/99435/60 >`__
1112
1213
1314Abstract
@@ -772,10 +773,8 @@ Beyond the proposal outlined above, the following were also considered:
772773
773774 This strategy would also make unpacking in synchronous and asynchronous
774775 generators behave symmetrically, but it would also be more complex, enough
775- so that the cost may not be worth the benefit. As such, this PEP proposes
776- that asynchronous generator expressions using the unpacking operator should
777- not adopt semantics similar to ``yield from `` until ``yield from `` is
778- supported in asynchronous generators more generally.
776+ so that the cost may not be worth the benefit, particularly in the absense
777+ of a compelling use case for delegation.
779778
7807793. Using ``yield from `` for unpacking in synchronous generator expressions, and
781780 disallowing unpacking in asynchronous generator expressions until they
@@ -790,20 +789,20 @@ Beyond the proposal outlined above, the following were also considered:
7907894. Disallowing unpacking in all generator expressions.
791790
792791 This would retain symmetry between the two cases, but with the downside of
793- losing a very expressive form.
794-
792+ losing an expressive form and symmetry between list/set comprehensions and
793+ generator expressions.
795794
796795Each of these options (including the one presented in this PEP) has its
797796benefits and drawbacks, with no option being clearly superior on all fronts.
798797The semantics proposed in :ref: `pep798-genexpsemantics ` above represent a
799798reasonable compromise by allowing exactly the same kind of unpacking in
800799synchronous and asynchronous generator expressions and retaining an existing
801- property of generator expressions (that they do not
800+ property of generator expressions (that they do not delegate to subgenerators).
802801
803802This decision should be revisited in the event that asynchronous generators
804803receive support for ``yield from `` in the future, in which case adjusting the
805- semantics of unpacking in async generator expressions to use ``yield from ``
806- should be considered.
804+ semantics of unpacking in generator expressions to use ``yield from `` should be
805+ considered.
807806
808807
809808Concerns and Disadvantages
0 commit comments