Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76292

Re: [Q] is 'yield from' syntax sugar for 'for'+'yield'?

From Marko Rauhamaa <marko@pacujo.net>
Newsgroups comp.lang.python
Subject Re: [Q] is 'yield from' syntax sugar for 'for'+'yield'?
Date 2014-08-14 13:32 +0300
Organization A noiseless patient Spider
Message-ID <87oavntl96.fsf@elektro.pacujo.net> (permalink)
References <CAFTm5Ru8nfNt2UtyeBiEh-7Cf5RQZShYV9ha=6HACifCcVUG4w@mail.gmail.com> <CAPTjJmo-0aqxeosa1bM=jtuAdwoZLiiG20kDp7RGvP3Zx65_9w@mail.gmail.com> <mailman.12990.1408010368.18130.python-list@python.org>

Show all headers | View raw


Makoto Kuwata <kwatch@gmail.com>:

> Thank you. It seems too complicated...

I recommend you stop trying to associate the "old" yield with the "new"
yield.

Asyncio coroutines "abuse" "yield from" for a specific effect. The
classic purpose of "yield" was to spoonfeed a sequence of return values
to the caller. The coroutine meaning of "yield from" has nothing
whatsoever to do about delivering computation results; instead, it
denotes a state where a blocking operation is waited for and the control
is handed off to other activities.



Marko

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [Q] is 'yield from' syntax sugar for 'for'+'yield'? Makoto Kuwata <kwatch@gmail.com> - 2014-08-14 18:59 +0900
  Re: [Q] is 'yield from' syntax sugar for 'for'+'yield'? Marko Rauhamaa <marko@pacujo.net> - 2014-08-14 13:32 +0300

csiph-web