<div dir="ltr">Sorry, I should have been more precise, first the far right hand side is evaluated, so you get the string 'b' (of course). Then the assignments are evaluated left to right.<div><br></div><div>So first:</div>
<div><br></div><div style>a['a'] = 'b'</div><div style><br></div><div style>Then </div><div style><br></div><div style>a[a['a']] = 'b'</div><div style><br></div><div style>Now a['a'] == 'b'</div>
<div style><br></div><div style>so a['b'] = 'b'.</div><div style><br></div><div style>Alex</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 1, 2013 at 8:41 PM, Brantley Harris <span dir="ltr"><<a href="mailto:deadwisdom@gmail.com" target="_blank">deadwisdom@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Okay, then it should be a key error:<div class="im"><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">> a['a'] = a[a['a']]</span><br>
</div></div><div><font face="arial, sans-serif">KeyError: 'a'</font><br>
</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 1, 2013 at 10:25 PM, Alex Gaynor <span dir="ltr"><<a href="mailto:alex.gaynor@gmail.com" target="_blank">alex.gaynor@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The assignments are going left to right.<div><br></div><div>Alex</div></div><div class="gmail_extra"><br>

<br><div class="gmail_quote"><div><div>On Mon, Apr 1, 2013 at 8:24 PM, Brantley Harris <span dir="ltr"><<a href="mailto:deadwisdom@gmail.com" target="_blank">deadwisdom@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div>> a = {}</div>> a['a'] = a[a['a']] = 'b'<br>
<div>{'a': 'b', 'b': 'b'}<br>
</div><div><br></div><div>What the what?  I would think that should KeyError, but it runs fine.  Someone splain.</div>
</div>
<br></div></div>_______________________________________________<br>
Chicago mailing list<br>
<a href="mailto:Chicago@python.org" target="_blank">Chicago@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/chicago" target="_blank">http://mail.python.org/mailman/listinfo/chicago</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br>"I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire)<br>

"The people's good is the highest law." -- Cicero<br>

</font></span></div>
<br>_______________________________________________<br>
Chicago mailing list<br>
<a href="mailto:Chicago@python.org" target="_blank">Chicago@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/chicago" target="_blank">http://mail.python.org/mailman/listinfo/chicago</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Chicago mailing list<br>
<a href="mailto:Chicago@python.org">Chicago@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/chicago" target="_blank">http://mail.python.org/mailman/listinfo/chicago</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>"I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire)<br>"The people's good is the highest law." -- Cicero<br>

</div>