difference between import from mod.func() and x=mod.func()

Discussion in 'Python' started by Hari Sekhon, Jun 20, 2006.

  1. Hari Sekhon

    Hari Sekhon Guest

    What is the difference in terms of efficiency and speed between

    from os import path

    and

    import os
    path=os.path


    I would think that the import from would be better, just curious since I
    read somewhere on the web, some guy's code tutorial where he did the
    latter and said it was for efficiency/speed.
    Not sure if this is right.

    Seeing as python folks seem to value simplicity and cleanness, is there
    a preferred coding method? (again I would think the first to the the
    preferred)


    Hari
    Hari Sekhon, Jun 20, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jakk
    Replies:
    4
    Views:
    12,039
  2. Johnny
    Replies:
    3
    Views:
    443
    Robert Kern
    Aug 23, 2005
  3. Eric Hanchrow
    Replies:
    1
    Views:
    355
    Arnaud Delobelle
    May 9, 2008
  4. J. Cliff Dyer
    Replies:
    2
    Views:
    321
    Chuckk Hubbard
    May 8, 2008
  5. ryles
    Replies:
    3
    Views:
    515
    Piet van Oostrum
    Jul 26, 2009
Loading...

Share This Page