I should add (that as I understand it), when you do a &#39;from foo import blah&#39;, or &#39;from foo import *&#39;, this is doing a <i>copy</i> (effectively) of that module&#39;s attributes into the current namespace.  Doing &quot;import foo&quot; or &quot;import foo as goo&quot; is keeping a <i>reference </i>to the imported module rather than a copy.  <br>
<br>If you use the &#39;from import&#39; system, changes made to attrs of the imported module <i>won&#39;t</i> 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 changes made to attrs on the imported module <i>will </i>be seen by othe modules that import it as well.  I hope that is somewhat clear. ;)<br>
<br><div class="gmail_quote">On Sat, Jan 9, 2010 at 8:35 AM, Lowell Tackett <span dir="ltr">&lt;<a href="mailto:lowelltackett@yahoo.com">lowelltackett@yahoo.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;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">
If I might offer one small comment...<br><br>It seems to me that this argument also goes to a code readability issue; ergo, if you choose &quot;from foobar...&quot; as opposed to &quot;import foobar&quot;, then from that point on you only need employ foobar&#39;s methods in your code, and they are not alway easily recognizable.  i.e, by importing foobar, you will always prefix a method with its&#39; parent module name, which [I think] makes the code more understandable.<br>
<br><span style="font-family: comic sans ms;">From the <span style="font-style: italic;">virtual</span> desk of Lowell Tackett  <img src=""><br></span><br><br>--- On <b>Sat, 1/9/10, Alan Gauld <i>&lt;<a href="mailto:alan.gauld@btinternet.com" target="_blank">alan.gauld@btinternet.com</a>&gt;</i></b> wrote:<br>
<blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From:
 Alan Gauld &lt;<a href="mailto:alan.gauld@btinternet.com" target="_blank">alan.gauld@btinternet.com</a>&gt;<br>Subject: Re: [Tutor] Question on &quot;import foobar&quot; vs &quot;from foobar import *&quot;<br>To: <a href="mailto:tutor@python.org" target="_blank">tutor@python.org</a><br>
Date: Saturday, January 9, 2010, 10:21 AM<div><div></div><div class="h5"><br><br><div><br>&quot;Rob Cherry&quot; &lt;<a href="http://mc/compose?to=pythontutor@lxrb.com" target="_blank">pythontutor@lxrb.com</a>&gt; wrote<br>
<br>&gt; Extending on this advice somewhat - is it *ever* correct to &quot;import foobar&quot;.<br><br>Yes, it is *usually* correct to &quot;import foobar&quot; and rarely correct to &quot;from foobar&quot;.<br>The exception being if you only need one or two names from foobar, but<br>
usually you need a lot more, in which case use import foobar.<br><br>To save typing you can give foobar a shorter name:<br><br>import foobar as fb<br><br>For some reason that convenience feature doesn&#39;t get mentioned<br>
all that often but I use it a lot.<br><br>HTH,<br><br><br>-- Alan Gauld<br>Author of the Learn to Program web site<br><a href="http://www.alan-g.me.uk/" target="_blank">http://www.alan-g.me.uk/</a> <br></div></div></div></blockquote>
</td></tr></tbody></table><br></blockquote></div><br>