<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jul 17, 2018 at 8:28 AM, Serhiy Storchaka <span dir="ltr"><<a href="mailto:storchaka@gmail.com" target="_blank">storchaka@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">17.07.18 17:59, Guido van Rossum пише:<span class=""><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The PEP has no specific opinion except it is not forbidden.<br>
<br>
Personally I like Barry's example just fine -- assuming `subdirs` is not used later, this feels like a good use case.<br>
</blockquote>
<br></span>
Shouldn't this problem be solved in the same way as for comprehensions?<br></blockquote><div><br></div><div>No, it's nothing like those.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Should not the assert statement introduce an implicit lexical scope for preventing leaking variables?<br></blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">I don't see why. As Chris said, side effects in asserts are nothing new and this PEP is not the one to do something about it.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Serhiy, have you even read the latest version of PEP 572? In its current form it does not introduce any implicit scopes and even goes out of its way to make assignments in comprehensions "leak" out of the comprehension scope into the surrounding (explicit, using 'def' or 'lambda') function's scope.<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>