0

There is a package. In the package's __init__.py there is __all__ defined which contains name of every module in package. If I then use

from package import *

will it import every module of that package so I can reference them by name?

Is it possible in Python to import every package's module with from x import * statement?

ENDrain
  • 1
  • 1

1 Answers1

0

Yes. But because of "namespace pollution" (not knowing which imported module you actually use because perhaps several of them have the same name), it is not recommended.

norway-yv
  • 222
  • 2
  • 12