Hi,<br><br><div class="gmail_quote">2011/6/7 Válas Péter <span dir="ltr">&lt;<a href="mailto:sulinet@postafiok.hu">sulinet@postafiok.hu</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
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). </blockquote><div><br>That&#39;s not correct:<br>
<br>Python 2.7 (r27:82525, Jul  4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)] on win<br>32<br>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<br>&gt;&gt;&gt; x=[1,2,3]<br>
&gt;&gt;&gt; y=x<br>&gt;&gt;&gt; id(x)<br>36115464L<br>&gt;&gt;&gt; id(y)<br>36115464L<br>&gt;&gt;&gt; x.append(4)<br>&gt;&gt;&gt; id(x)<br>36115464L<br>&gt;&gt;&gt; id(y)<br>36115464L<br>&gt;&gt;&gt; x<br>[1, 2, 3, 4]<br>
&gt;&gt;&gt;<br><br>As you can see, x and y are references to the same object (e.g. with the same id.)<br><br>Regards<br><br>Walter<br></div></div>