Does python import all the listed libraries? - Python

Posted by RadiantHex on Stack Overflow See other posts from Stack Overflow or by RadiantHex
Published on 2010-03-19T19:01:43Z Indexed on 2010/03/19 19:11 UTC
Read the original article Hit count: 365

Filed under:
|
|
|

Hi folks,

I'm just wondering, I often have really long python files and imports tend to stack quite quickly.

PEP8 says that the imports should always be written at the beginning of the file.


Do all the imported libraries get imported when calling a function coded in the file? Or do only the necessary libraries get called?

Does it make sense to worry about this? Is there no reason to import libraries within the functions or classes that need them?

© Stack Overflow or respective owner

Related posts about python

Related posts about pep8