Efficiency/style issues of import <module> vs. from <module> import <name>, ...

python at bdurham.com python at bdurham.com
Thu Jun 17 12:12:34 EDT 2010


Are there any efficiency or style guidelines regarding the choice
of "import <module>" vs. "from <module> import <name>, ..."?

If one only needs to import a few names from a module, are there
specific benefits to explictly importing these names?

My understanding is that both forms of the import command require
the entire module to be processed.

If this comes down purely to preference, are there PEP 8-like
standards regarding which approach to use when?

Thanks,
Malcolm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100617/f183c264/attachment.html>


More information about the Python-list mailing list