On Wed, Sep 6, 2017 at 8:07 AM, Koos Zevenhoven <k7ho...@gmail.com> wrote:

> I think yield from should have the same semantics as iterating over the
> generator with next/send, and PEP 555 has no issues with this.
>

I think the onus is on you and Greg to show a realistic example that shows
why this is necessary.

So far all the argumentation about this has been of the form "if you have
code that currently does this (example using foo) and you refactor it in
using yield from (example using bar), and if you were relying on context
propagation back out of calls, then it should still propagate out."

This feels like a very abstract argument. I have a feeling that context
state propagating out of a call is used relatively rarely -- it  must work
for cases where you refactor something that changes context inline into a
utility function (e.g. decimal.setcontext()), but I just can't think of a
realistic example where coroutines (either of the yield-from variety or of
the async/def form) would be used for such a utility function. A utility
function that sets context state but also makes a network call just sounds
like asking for trouble!

-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to