<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
On 26.06.2018 0:13, Steve Holden wrote:<br>
<blockquote type="cite"
cite="mid:CAMofdRDDtK2FT2OYm_UFi2Sa8ygazJv_AUwRFGL5+LJbrQNtQA@mail.gmail.com">
<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"
moz-do-not-send="true">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>
</div>
</blockquote>
<p>I did:</p>
for l in (l.rstrip() for l in f):<br>
<br>
The provisional unstripped line variable is totally unneeded in the
following code.<br>
<br>
<blockquote type="cite"
cite="mid:CAMofdRDDtK2FT2OYm_UFi2Sa8ygazJv_AUwRFGL5+LJbrQNtQA@mail.gmail.com">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<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>
<!--'"--><br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Python-Dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Python-Dev@python.org">Python-Dev@python.org</a>
<a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/listinfo/python-dev">https://mail.python.org/mailman/listinfo/python-dev</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://mail.python.org/mailman/options/python-dev/vano%40mail.mipt.ru">https://mail.python.org/mailman/options/python-dev/vano%40mail.mipt.ru</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Regards,
Ivan</pre>
</body>
</html>