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

H

Hari Sekhon

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top