|
|
|
|
|
by apetresc
1232 days ago
|
|
Oh yeah, imports in Python are not just, like, extending a namespace like in many other languages. They, at runtime, go and run the module's __init__ and can have arbitrary side effects - an entire program can run (although usually shouldn't) just in the import. Imports of large modules often take entire seconds. It is absolutely worthwhile to avoid unnecessary imports if possible. |
|