<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Mar 27, 2018 at 11:51 AM, Ivan Levkivskyi <span dir="ltr"><<a href="mailto:levkivskyi@gmail.com" target="_blank">levkivskyi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On 27 March 2018 at 19:43, Ethan Furman <span dir="ltr"><<a href="mailto:ethan@stoneleaf.us" target="_blank">ethan@stoneleaf.us</a>></span> wrote:<br></span><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 03/27/2018 11:12 AM, Ivan Levkivskyi wrote:<span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 27 March 2018 at 18:19, Guido van Rossum wrote:<br>
</blockquote>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hm, so maybe we shouldn't touch lambda, but we can at least fix the scope issues for comprehensions and genexprs.<br>
</blockquote>
<br>
Removing the implicit function scope in comprehensions is something I wanted for long time.<br>
It would not only "fix" the scoping, but will also fix the yield inside comprehensions.<br>
</blockquote>
<br></span>
Can we do it without leaking names?<br>
<br></blockquote><div><br></div></span><div>If you mean this</div><div><br></div><div>[i for i in range(5)]</div><div><br></div><div>i # NameError</div><div><br></div><div>then yes, this is possible. Serhiy outlined the implementation few moths ago. The rough idea is to use automatic re-naming.</div><div>The only problem with this is that if someone will step into debugger one will see a name like <comp>.0.i instead of i.</div><div>But this can be solved in the debuggers. <br></div></div></div></div></blockquote></div><br></div><div class="gmail_extra">Oh, sorry, I misread what you were talking about. You're proposing going back to the Python 2 shared namespace. I'm not at all excited about that, and I'm not convinced that adjusting debuggers to hide the name mangling is effective -- it does nothing about other forms of introspection. Also depending on how PEP 572 falls there may be assignments in there. Plus there may be object lifetime consequences.<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>