<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Jan 23, 2016 at 8:54 AM, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Also, once again the semantics of lambda (specifically, that unlike<br></blockquote></span><span class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
def it doesn't create a scope)</blockquote><div><br></div></span><div>Uh, what? I can sort of guess what you are referring to here (namely, that no syntactic construct permissible in a lambda can assign to a local variable -- or any variable, for that matter).</div></div></div></div></blockquote><div> </div><div>That's not even quite true, you can assign to global variables in a lambda:</div><br>>>> myglobal = 1 </div><div class="gmail_quote">>>> f = lambda: globals().__setitem__('myglobal', 2) or 42 </div><div class="gmail_quote">>>> f() </div><div class="gmail_quote">>>> myglobal<br>2<div> </div></div><div><br></div>-- <br><div class="gmail_signature">Keeping medicines from the bloodstreams of the sick; food <br>from the bellies of the hungry; books from the hands of the <br>uneducated; technology from the underdeveloped; and putting <br>advocates of freedom in prisons. Intellectual property is<br>to the 21st century what the slave trade was to the 16th.<br></div>
</div></div>