Skip to content

Commit 53d9444

Browse files
committed
wording changes
1 parent bb3706d commit 53d9444

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

peps/pep-0798.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ should use ``yield from`` (or an equivalent) when unpacking, as opposed to an
741741
explicit loop. The main difference between these options is whether the
742742
resulting generator delegates to the objects being unpacked (see :pep:`380`),
743743
which would affect the behavior of these generator expressions when used with
744-
``.send()/.asend()``, ``.throw()/.athrow()``, and ``.close()/.aclose()``, in
744+
``.send()/.asend()``, ``.throw()/.athrow()``, and ``.close()/.aclose()`` in
745745
the case where the objects being unpacked are themselves generators, which
746746
is unlikely to be a common use case.
747747

@@ -768,16 +768,18 @@ Beyond the proposal outlined above, the following were also considered:
768768
generators behave symmetrically, but it would also be more complex, enough
769769
so that the cost may not be worth the benefit, particularly in the absence
770770
of a compelling practical use case for delegating to subgenerators during
771-
unpacking.
771+
unpacking. Generator expressions using the unpacking operator should not
772+
use semantics similar to ``yield from`` until ``yield from`` is supported
773+
in asynchronous generators more generally.
772774

773775
3. Using ``yield from`` for unpacking in synchronous generator expressions, and
774776
disallowing unpacking in asynchronous generator expressions until they
775777
support ``yield from``.
776778

777779
This strategy could possibly reduce friction if asynchronous generator
778780
expressions do gain support for ``yield from`` in the future by making sure
779-
that any decision made at that point would be fully backwards-compatible,
780-
but the utility of unpacking in that context seems to outweigh the potential
781+
that any decision made at that point would be fully backwards-compatible.
782+
But the utility of unpacking in that context seems to outweigh the potential
781783
downside of a backwards-incompatible change in the future if aync generator
782784
expressions do receive support for ``yield from``.
783785

@@ -791,7 +793,8 @@ Each of these options (including the one presented in this PEP) has its
791793
benefits and drawbacks, with no option being clearly superior on all fronts;
792794
but the semantics proposed in :ref:`pep798-genexpsemantics` represent a
793795
reasonable compromise where unpacking in both synchronous and asynchronous
794-
generator expressions mirrors common ways of writing equivalent generators.
796+
generator expressions mirrors common ways of writing equivalent generators
797+
currently.
795798

796799
As suggested above, though, this decision should be revisited in the event that
797800
asynchronous generators receive support for ``yield from`` in the future, in

0 commit comments

Comments
 (0)