Suppose I have a module foo.py and a package foo/. If I call
foo.py
foo/
import foo
which one will be loaded? How can I specify I want to load the module, or the package?
I believe the package will always get loaded. You can't work around this, as far as I know. So change either the package or the module name. Docs: http://docs.python.org/tutorial/modules.html#the-module-search-path
2.1m questions
2.1m answers
60 comments
57.0k users