Project structure - Best practices

Aahz aahz at pythoncraft.com
Mon Dec 1 10:57:33 EST 2008


In article <2d1f986f-94da-49c8-a1a5-df9457d5f8b3 at r36g2000prf.googlegroups.com>,
Rafe  <rafesacks at gmail.com> wrote:
>
>...and I completely agree. I always use the standard import form
>unless absolutely necessary. However, I use 'as' to shorten the path
>to the last module. For example:
>>>> import app.foo.bar as bar
>>>> instance = bar.Class()

Why bother with ``as`` in this case?

from app.foo import bar
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan



More information about the Python-list mailing list