<p>Apologies for the top post, my phone doesn&#39;t allow editing the message body.</p>
<p>You are slightly confused - ints are not mutable! You can combine or multiply them, along with several other operations, but they are certainly not mutable. The easiest way to check is use them as keys in a dict. You can&#39;t do that with lists or other mutable types. Since I don&#39;t have computer access right now I can&#39;t look up the docs on id, but hopefully someone else can enlighten you. But ints are definitely immutable. I suspect you&#39;re confusing the fact that you can easily reassign ints with mutability.</p>

<p>HTH, <br>
Wayne</p>
<p><blockquote type="cite">On Jun 7, 2011 5:50 PM, &quot;Válas Péter&quot; &lt;<a href="mailto:sulinet@postafiok.hu">sulinet@postafiok.hu</a>&gt; wrote:<br><br>Hi,<br><br>let X be a mutable container, such as dict/set/list=bytearray, and Y=X,<br>
When I change X, Y will follow it, having always the same value, although id(X)!=id(Y). How is that, what is the explanation? Meanwhile the same for immutable types results a real copy, and so does for simple mutables such as int.<br>

<br>I suspect it has something to do with pointers, but what is the difference between mutables and immutables, and why have they different id&#39;s if they are the same?<br>
<br>_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
<br></blockquote></p>