Import speeds

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • musicfreak
    New Member
    • Jan 2009
    • 17

    Import speeds

    I tried Googling around for this but I couldn't find anything useful.

    I know Python caches modules so they only have to be imported once, but is there a performance hit when using the wildcard import? For example, is this...
    Code:
    from some_module import *
    ...slower than this?
    Code:
    import some_module
    Thanks in advance.
  • QwertyManiac
    New Member
    • Dec 2008
    • 2

    #2
    In cases of large modules (like PyQt4), then yes, the wild card import is slower, as it takes all the objects and fills them into your current name-space.

    Comment

    Working...