Showing content from http://mail.python.org/pipermail/python-dev/attachments/20171122/f85a4930/attachment.html below:
<div dir="ltr">On 22 November 2017 at 15:46, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Wed, 22 Nov 2017 15:15:49 +0100<br>
Ivan Levkivskyi <<a href="mailto:levkivskyi@gmail.com">levkivskyi@gmail.com</a>> wrote:<br>
> There are many things that I would reject in code review, but they are<br>
> still allowed in Python,<br>
> this is one of the reasons why code reviews exist. Also I am not sure how<br>
> `yield` in a comprehension<br>
> is more tricky than `await` in a comprehension.<br>
<br>
</span>I am not sure either, but do note that "yield" and "await" are two<br>
different things with different semantics, so allowing "await" while<br>
disallowing "yield" wouldn't strike me as inconsistent.<br>
<br>
The exact semantics of "yield" inside a comprehension is a common<br>
source of surprise or bewilderment, and the only actual use I've seen<br>
of it is to show it off as a "clever trick". So instead of fixing (and<br>
perhaps complicating) the implementation to try and make it do the<br>
supposedly right thing, I am proposing to simply disallow it so that<br>
we are done with the controversy :-)<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>Actually, I am not sure there is really a controversy, I have not yet met a person who _expects_</div><div>`yield` in a comprehension to work as it works now, instead everyone thinks it is just equivalent to a for-loop.</div><div><br></div><div>Anyway, I have some compromise idea, will send it in a separate e-mail.</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