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/2140fcec/attachment.html below:

<div dir="ltr">On 23 November 2017 at 09:17, Greg Ewing <span dir="ltr"><<a href="mailto:greg.ewing@canterbury.ac.nz" target="_blank">greg.ewing@canterbury.ac.nz</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Ivan Levkivskyi wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
"People sometimes want to refactor for-loops containing `yield` into a comprehension<br>
</blockquote>
<br></span>
By the way, do we have any real-life examples of people wanting to<br>
do this? It might help us decide what the semantics should be.<br>
<br></blockquote><div><br></div><div>Yes, there are two SO questions in two first posts here, also there are some b.p.o. issues. It looks like in all case people expect:</div><div><br></div><div>    def f():</div><div>        return [(yield i) for i in range(3)]</div><div><br></div><div>to be roughly equivalent to</div><div><br></div><div>    def f():</div><div>        res = []</div><div>        for i in range(3):</div><div>            r = yield i<br></div><div>            res.append(r)</div><div>        return res</div><div><br></div><div>See Serhiy's original post for more detailed proposed semantic equivalence.</div><div><br></div><div>--</div><div>Ivan</div><div><br></div><div><br></div></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