<div dir="ltr"><div class="gmail_default" style="font-size:small">On Mon, Jun 25, 2018 at 8:37 PM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu" target="_blank">tjreedy@udel.edu</a>></span> wrote:<br></div><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 6/24/2018 7:25 PM, Guido van Rossum wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I'd wager that the people who might be most horrified about it<br>
</blockquote>
<br></span>
the (b) scoping rule change<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
would be people who feel strongly that the change to the<br>
comprehension scope rules in Python 3 is a big improvement,<br>
</blockquote>
<br></span>
I might not be one of those 'most horrified' by (b), but I increasingly don't like it, and I was at best -0 on the comprehension scope change. To me, iteration variable assignment in the current scope is a non-problem.  So to me the change was mostly useless churn.  Little benefit, little harm.  And not worth fighting when others saw a benefit.<br>
<br>
However, having made the change to nested scopes, I think we should stick with them.  Or repeal them.  (I believe there is another way to isolate iteration names -- see  below).  To me, (b) amounts to half repealing the nested scope change, making comprehensions half-fowl, half-fish chimeras.<br></blockquote><div><div class="gmail_default" style="font-size:small;display:inline">​[...]​</div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
-- <br>
Terry Jan Reedy</font></span><div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><div class="gmail_default" style="font-size:small;display:inline">​I'd like to ask: how many readers of ​</div> <div class="gmail_default" style="font-size:small;display:inline">​this email have ever deliberately taken advantage of the limited Python 3 scope in comprehensions and generator expressions to use what would otherwise be a conflicting local variable name?​</div></div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline">I appreciate that the scope limitation can sidestep accidental naming errors, which is a good thing.</div></div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline">Unfortunately, unless we anticipate Python 4 (or whatever) also making for loops have an implicit scope, I am left wondering whether it's not too large a price to pay. After all, special cases aren't special enough to break the rules, and unless the language is headed towards implicit scope for all uses of "for" one could argue that the scope limitation is a special case too far. It certainly threatens to be yet another confusion for learners, and while that isn't the only consideration, it should be given due weight.</div></div></div></div></div>