A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20171123/1a81987c/attachment.html below:

<div dir="ltr">On 23 November 2017 at 13:30, Antoine Pitrou <span dir="ltr"><<a href="mailto:solipsis@pitrou.net" target="_blank">solipsis@pitrou.net</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Thu, 23 Nov 2017 14:17:32 +0200<br>
Serhiy Storchaka <<a href="mailto:storchaka@gmail.com">storchaka@gmail.com</a>> wrote:<br>
><br>
> I used the "yield" statement, but I never used the "yield" expressions.<br>
> And I can't found examples. Could you please present a real-world use<br>
> case for the "yield" (not "yield from") expression?<br>
<br>
</span>Of course I can.  "yield" expressions are important for writing<br>
Python 2-compatible asynchronous code while avoiding callback hell:<br>
<br>
See e.g. <a href="http://www.tornadoweb.org/en/stable/gen.html" rel="noreferrer" target="_blank">http://www.tornadoweb.org/en/<wbr>stable/gen.html</a><br><a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank"><br></a></blockquote><div><br></div>Great, so I open this page and see this code:<br><br>results = []<br>for future in list_of_futures:<br>  Â  results.append(yield future)<br><br>Interesting, why don't they use a comprehension for this and instead need to invent a whole `tornado.gen.multi` function? <br></div><div class="gmail_quote"><br></div><div class="gmail_quote">--</div><div class="gmail_quote">Ivan</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div></div></div>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4