<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 23, 2010, at 1:47 PM, Andrey Fedorov wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I imagine this has been covered before, but somehow my Google-foo is failing. What are people's opinions about having an anaphoric-if syntax sugar like:<div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">


<div><font face="'courier new', monospace">if foo() as x:</font></div><div><font face="'courier new', monospace">    ... x</font></div></blockquote><div><br>
</div><div>meaning</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="'courier new', monospace">x = foo()</font></div>
<div><font face="'courier new', monospace">if x:</font></div><div><font face="'courier new', monospace">    ... x</font></div></blockquote><div><br></div><div>?</div><div><br></div><div>
I do this a lot, and it seems very un-Pythonically verbose to repeat "x" (especially when a longer variable name is appropriate).</div></blockquote></div><br><div>Yes, this has come up before.</div><div>FWIW, I'm +1 on the idea,</div><div>especially if it can be also applied to while-loops.</div><div>It looks very readable</div><div><br></div><div>We do have a language moratorium in effect,</div><div>so your odds of success are slim.</div><div><br></div><div><br></div><div>Raymond</div><div><br></div></body></html>