So this seems like it will make scope/namespaces a bit interesting...<br><br>Any good references on why this is this way?<br>I.e., why assignment passes across scopes instead of copy.<br>Or is it just explicit versus implicit?
<br><br><br><br><div class="gmail_quote">On Jan 21, 2008 9:32 PM, John Fouhy &lt;<a href="mailto:john@fouhy.net">john@fouhy.net</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On 22/01/2008, John Morris &lt;<a href="mailto:jrmorrisnc@gmail.com">jrmorrisnc@gmail.com</a>&gt; wrote:<br>&gt; I thought each class got it&#39;s own namespace and this sharing of mutable<br>&gt; objects is confusing me.
<br><br></div>Each class gets its own namespace, but names are different from<br>objects. &nbsp;For example:<br><br>&gt;&gt;&gt; x = [1, 2, 3]<br>&gt;&gt;&gt; y = x<br>&gt;&gt;&gt; y.append(4)<br>&gt;&gt;&gt; x<br>[1, 2, 3, 4]
<br><br>In this case, x and y are both different names for the same object.<br>Classes increase the name space, but they don&#39;t change the fact that<br>in python, assignment is just giving something a new name.<br><br>
--<br><font color="#888888">John.<br></font></blockquote></div><br><br clear="all"><br>-- <br>John Morris<br><a href="mailto:jrmorrisnc@gmail.com">jrmorrisnc@gmail.com</a><br>&quot;Do nothing which is of no use.&quot; -- Miyamoto Musashi
<br>&lt;a href=&quot;<a href="http://profile.mygamercard.net/nerdality">http://profile.mygamercard.net/nerdality</a>&quot;&gt;<br>&lt;img src=&quot;<a href="http://card.mygamercard.net/gbar/abyss/nerdality.gif">http://card.mygamercard.net/gbar/abyss/nerdality.gif
</a>&quot; border=0&gt;<br>&lt;/a&gt;