<div>You are confusing &quot;names&quot; (variables) and &quot;objects&quot;.</div><div>In the first, `a=20`, the &quot;name&quot; `a` is bound to the &quot;object&quot; `20`.</div><div>In the second, `a=22`, the &quot;name&quot; `a` is re-bound to another &quot;object&quot;, `22`.</div>

<div><br></div><div>Regardless, the &quot;identity&quot; of either &quot;objects&quot;--`20` and `22`--never changes.</div><div><br clear="all"></div>~/santa<br>
<br><br><div class="gmail_quote">On Sat, Mar 5, 2011 at 9:15 AM, Mark Ballard <span dir="ltr">&lt;<a href="mailto:markjballard@googlemail.com">markjballard@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div>Hello<br clear="all"></div><div><br></div><div>I&#39;m having a lot of fun reading your excellent Python documentation.</div><div><br></div><div>I have found a discrepancy that may be attributable to my ignorance, but is possibly an error, in the section of the documentation dealing with Objects, Values and Types:</div>


<div><br></div><div><a href="http://docs.python.org/reference/datamodel.html#index-820" target="_blank">http://docs.python.org/reference/datamodel.html#index-820</a><br></div><div><br></div><div>The documentation says:</div>

<div><br></div>
<div>&quot;An object’s identity never changes once it has been created&quot;</div><div><br></div><div>While using the interpreter to illustrate the points in the documentation, it appeared to me that an object&#39;s identity does change with its value.</div>


<div><br></div><div>This, for example, is copied from my interpreter and appears to show that the id of the object a does change when I change its value:</div><div><br></div><div>&gt;&gt;&gt; a=20<br></div><div><br></div>


<div>&gt;&gt;&gt; id(a)<br></div><div>137972908<br></div><div><br></div><div>&gt;&gt;&gt; a=22<br></div><div><br></div><div>&gt;&gt;&gt; id(a)<br>137972884<br><br></div><div>I hope this is of some help.</div><div><br></div>


<div>Best regards</div><div><br></div><font color="#888888"><div>Mark.</div>
</font><br>_______________________________________________<br>
docs mailing list<br>
<a href="mailto:docs@python.org">docs@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/docs" target="_blank">http://mail.python.org/mailman/listinfo/docs</a><br>
<br></blockquote></div><br>