John Mark Agosta wrote:

> Matthew -
>
> Yes, its pretty clever, I tried it. I noticed that on subsequent edits you
> don't have to re-execute the
> "import ftplib", which is convenient if you are entering this manually.

Note that there are other reasons for avoiding "from module import *", and this is
just one symptom of the awkwardness that it creates.

Really, honestly -- you are much better off using standard import syntax and
explicitly qualifying all those names.  I deliberately did not post the hackish
workaround that Matthew suggested because continuing to use the workarounds will
set you up to shoot yourself in the foot.  You can search the comp.lang.python and
python tutor mailing list archives for lots of discussion about why "from module
import *" is usually a dangerous idea.

(As an analogy, you can overclock your PC to make it run faster, so why isn't
everyone doing it?  Because it's likely to cause problems eventually, even if you
can get away with it for a while.  Using "from module import *" won't fry your
hardware, but it can end up costing a *lot* of wasted time tracking down bugs.)

Jeff Shannon
Technician/Programmer
Credit International


_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython

Reply via email to