<meta http-equiv="content-type" content="text/html; charset=utf-8">Now its all clear. Thanks<div>@ethan .. ur example is really scary.</div><div>I didnt understand ur example fully although.</div><div>See this is what i take it as:</div>
<div>x=x['huh']={}</div><div><br></div><div>>first python checks check that there are two = operators.</div><div>>so it evaluates the RHS(since for = it is RHS to LHS) experession of right most (why is that?)<br>
</div><div>>now it assigns that experrsion({...}) to x the left most as u said first RHS to LHS then LHS to RHS.</div><div>>then it assigns x to to x['huh'].</div><div>huh!!, ryt?</div><div>may be it doesnt make sense but i guess this is the only way to actually not raise an error.</div>
<div><br></div><div>Where am I wrong?</div><div><br></div><div><br></div><div><br></div><div><br></div><br><div class="gmail_quote">On Fri, Jun 24, 2011 at 10:02 AM, Chetan Harjani <span dir="ltr"><<a href="mailto:chetan.harjani@gmail.com">chetan.harjani@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>x=y="some string"</div><div>And we know that python interprets from left to right. so why it doesnt raise a name error here saying name 'y' is not defined?</div>
<div><br></div><div>another example:</div>
<div>(1,2) + 3, </div><div>here, python raises a TypeError "can only concatenate tuple(not int) to tuple" but we know (3,) is a tuple as seen by following:</div><div>t=3,</div><div>type(t)</div><div><type 'tuple'></div>
<div>Arent both of this contradicting?</div><br><font color="#888888">-- <br>Chetan H Harjani<br><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Chetan H Harjani<br><br><br>