<div dir="ltr"><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">Implementation details - even just partial sketches - are always<br>
"busy".  Think of it this way instead:  it's _currently_ the case that<br>
listcomps & genexps run in a scope S that's the same as the scope C<br>
that contains them, _except_ that names appearing as `for` targets are<br>
local to S.  All other names in S resolve to exactly the same scopes<br>
they resolved to in C (local in C, global in C, nonlocal in C -<br>
doesn't matter).<br>
<br>
What changes now?  Nothing in that high-level description, except that<br>
a name appearing as a binding expression target in S that's otherwise<br>
unknown in C establishes that the name is local to C.  That's nothing<br>
essentially new, though - bindings _always_ establish scopes for<br>
otherwise-unknown names in Python.</blockquote><div><br></div><div>That's a very nice (and short) explanation!</div><div><br></div><div>Maybe my distrust is just don't like the new syntax, or that I'am biased towards using "as".</div></div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><span style="color:rgb(0,102,0)">Juancarlo </span><b style="color:rgb(0,102,0)">Añez</b></div>
</div></div>