<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2018-04-11 16:50 GMT+03:00 Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com" target="_blank">rosuav@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><br>
</span>Can you give an example of how your syntax is superior to the more<br>
general option of simply allowing "as" bindings in any location?<br>
<br></blockquote></div><br>
<span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">This is not my syntax :) And not even my idea</span></span>. 
<span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">I just do not understand, and even a little skeptical about
 allowing "as" bindings in **any location** with global scoping. 
<span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">All the examples in this thread and the previous ones, as well as almost all PEP's examples show how this feature will be useful in `if`, `while` statements and comprehension/generator expressions. <span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">And it excellently solves this problem</span></span>.  T<span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">his feature increases 
the capabilities of these statements and also positively affects the 
readability of the code and it seems to me that everyone understands 
what this means in this context without ambiguity in their meaning in `while` or `with`</span></span> statements.<br><br>
<span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">The remaining examples (general ones) are far-fetched, and <span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">I do not have much desire to discuss them :) 
<span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">These include</span></span>:<br></span></span></span></span></span></span></span></span></div><div class="gmail_extra" style="margin-left:40px"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">
 <span style="font-family:monospace,monospace"><br>lambda: x := lambda y: z := a := 0</span></span></span></span></span></span></span></span></span><span style="font-family:monospace,monospace"><br></span><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-"><span style="font-family:monospace,monospace">
y = (<span class="gmail-im">(eggs := spam()), (cheese := eggs.method()), cheese[eggs])</span> 

</span><br></span></span></span></span></span></span></span></span></div><div class="gmail_extra" style="margin-left:40px"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">and others of these kind...<br></span></span></span></span></span></span></span></span></div><div class="gmail_extra"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-"> <br></span></span></span></span></span></span></span></span><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"></span></span></span></span>
<span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">Thus, I do not 
understand why to solve such a general and complex problem, when this 
syntax is convenient only in specific cases. 
<span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">In addition, previously the concept of a 
Statement-Local Name Bindings was discussed, <span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">which I basically like</span></span> (and it fits the above idea). 
<span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">In this version, it was abandoned completely</span></span>,


<span id="gmail-result_box" class="gmail-short_text" lang="en"><span class="gmail-">but it is unclear for what reasons</span></span>.<br></span></span> <br></span></span></div><div class="gmail_extra"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">p.s.: 
<span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">Maybe someone has use-cases outside 
<span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">`if`, `while`</span></span></span></span>

and comprehensions, but so far no one has demonstrated them</span></span>.<br></span></span></div><div class="gmail_extra"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-"><br></span></span></div><div class="gmail_extra"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">With kind regards,<br></span></span></div><div class="gmail_extra"><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">-gdg<br></span></span></div></div>