The good "import" convention?
newgene
newgene at bigfoot.com
Fri Feb 22 15:35:13 EST 2002
More information about the Python-list mailing list
Fri Feb 22 15:35:13 EST 2002
- Previous message (by thread): The good "import" convention?
- Next message (by thread): The good "import" convention?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, group,
When I write a python module, I got a question about the location
of "import" statement.
1. import all needed modules in the top of the code. Some modules
might be used in only one function.
import module1,module2,...
import ...
def f1():
....
def f2():
....
2. import needed modules in each functions. Some common modules like
"os", might be imported in multiple functions.
def f1():
import module1
...
def f2():
import module1,modules2
...
Which one is better or they are the same for the performance?
Thanks.
NewGene
- Previous message (by thread): The good "import" convention?
- Next message (by thread): The good "import" convention?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list