Skip to content

Commit b6266fb

Browse files
committed
a few more wording tweaks
1 parent b3bab6d commit b6266fb

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

peps/pep-0798.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Type: Standards Track
88
Created: 19-Jul-2025
99
Python-Version: 3.15
1010
Post-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

1314
Abstract
@@ -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

780779
3. 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:
790789
4. 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

796795
Each of these options (including the one presented in this PEP) has its
797796
benefits and drawbacks, with no option being clearly superior on all fronts.
798797
The semantics proposed in :ref:`pep798-genexpsemantics` above represent a
799798
reasonable compromise by allowing exactly the same kind of unpacking in
800799
synchronous 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

803802
This decision should be revisited in the event that asynchronous generators
804803
receive 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

809808
Concerns and Disadvantages

0 commit comments

Comments
 (0)