<div>Despite &quot;locals&quot; being involved, 16884 is not a related issue.&nbsp; The problem in 16884 is with the delegate that&#39;s created for function a and the way that&nbsp;it&#39;s&nbsp;bound to the context in which&nbsp;the function&nbsp;was declared.&nbsp; And alas, 16884 is not fixed in beta 3.</div>

<div><br>&nbsp;</div>
<div class="gmail_quote">On Tue, Jun 24, 2008 at 12:41 AM, Jonathan Slenders &lt;<a href="mailto:jonathan@slenders.be">jonathan@slenders.be</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Does this mean that issue 16884 will be fixed as well in beta 3? 
<div><br><br>
<div class="gmail_quote">2008/6/24 Dino Viehland &lt;<a href="mailto:dinov@exchange.microsoft.com" target="_blank">dinov@exchange.microsoft.com</a>&gt;: 
<div>
<div></div>
<div class="Wj3C7c"><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">It seems to be fixed in beta 3. &nbsp;It&#39;s probably a bug in the interpreter as writing the snippet out and executing w/ execfile, which doesn&#39;t run under the interpreter, works in beta 2 as well.<br>
<br>The reason it got silently fixed was because between the two versions the interpreter was moved from M.S.Core.dll up to M.S.dll and a bunch of bugs were fixed along the way. &nbsp;In beta 3 the interpreter is also now always used for exec or eval - previously it avoided certain constructs it couldn&#39;t support.<br>

<div>
<div></div>
<div><br>-----Original Message-----<br>From: <a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a> [mailto:<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a>] On Behalf Of Dan Eloff<br>
Sent: Monday, June 23, 2008 7:02 PM<br>To: Discussion of IronPython<br>Subject: [IronPython] NameError: locals() is not defined?<br><br>In IronPython b2 I get:<br><br>&gt;&gt;&gt; s = &#39;&#39;&#39;<br>... def body(context):<br>
... &nbsp; &nbsp; def ccall():<br>... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; body = lambda: None<br>... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; context.update(locals())<br>... &nbsp; &nbsp; ccall()<br>...<br>... &#39;&#39;&#39;<br>&gt;&gt;&gt; d = {}<br>&gt;&gt;&gt; exec s in d<br>&gt;&gt;&gt; c = {}<br>
&gt;&gt;&gt; d[&#39;body&#39;](c)<br>Traceback (most recent call last):<br>&nbsp;File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;<br>&nbsp;File &quot;&quot;, line unknown, in Interpreted_body_1<br>NameError: name &#39;locals&#39; is not defined<br>
<br>This works fine in CPython:<br><br>&gt;&gt;&gt; s = &#39;&#39;&#39;<br>... def body(context):<br>... &nbsp; &nbsp; def ccall():<br>... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; body = lambda: None<br>... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; context.update(locals())<br>... &nbsp; &nbsp; ccall()<br>
...<br>... &#39;&#39;&#39;<br>&gt;&gt;&gt; exec s in d<br>&gt;&gt;&gt; c = {}<br>&gt;&gt;&gt; d[&#39;body&#39;](c)<br>&gt;&gt;&gt; c<br>{&#39;body&#39;: &lt;function &lt;lambda&gt; at 0x0359CCB0&gt;, &#39;context&#39;: {...}}<br>
<br>Any idea why?<br><br>Thanks,<br>-Dan<br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com" target="_blank">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
</div></div></blockquote></div></div></div><br></div><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br>