<br><br><div class="gmail_quote">On Sat, Jan 9, 2010 at 9:08 PM, Lie Ryan <span dir="ltr">&lt;<a href="mailto:lie.1296@gmail.com">lie.1296@gmail.com</a>&gt;</span> 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="im">On 1/10/2010 11:23 AM, Eric Pavey wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I should add (that as I understand it), when you do a &#39;from foo import<br>
blah&#39;, or &#39;from foo import *&#39;, this is doing a /copy/ (effectively) of<br>
that module&#39;s attributes into the current namespace.  Doing &quot;import foo&quot;<br>
or &quot;import foo as goo&quot; is keeping a /reference /to the imported module<br>
rather than a copy.<br>
</blockquote>
<br></div>
No, that&#39;s a roundabout way to look at it. Python&#39;s variable holds references to objects[1] and never the object themselves; name assignment statement in python never makes a copy of the object, but always makes a new reference to the same object. &quot;Assignment statements&quot; in python includes the &#39;=&#39;, &#39;from import&#39;, and regular &#39;import&#39; [2].<br>

<br>
[1] this is call-by-object <a href="http://effbot.org/zone/python-objects.htm" target="_blank">http://effbot.org/zone/python-objects.htm</a> <a href="http://effbot.org/zone/call-by-object.htm" target="_blank">http://effbot.org/zone/call-by-object.htm</a><br>

[2] there are other more obscure statements that is an &#39;assignment statement&#39; as well, such as &quot;with ... as ...&quot;, &quot;agumented assignment operators&quot;, dictionary/list assignment, etc. The list is non-exhaustive.<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If you use the &#39;from import&#39; system, changes made to attrs of the<br>
imported module /won&#39;t/ be seen by any other module that imported it.<br>
If you do just an &#39;import&#39; on a module (or &#39;import ... as ...&#39;), then<br>
changes made to attrs on the imported module /will /be seen by othe<br>
modules that import it as well.  I hope that is somewhat clear. ;)<br>
</blockquote>
<br></div>
Read both links to effbot&#39;s article, they should make it clear why the current behavior is the way it is.<br></blockquote></div><br>See, I figured I&#39;d get straightened out myself by posting that.  Those concepts help me out as well ;)  Always learning...<br>