I want to import the module foo and its submodule foo.bar. I can do that as follows:
import foo.bar
Now both foo and foo.bar are available as I want. The docs state this is due to foo being imported first:
In this case, Python first tries to import
foo, thenfoo.bar, and finallyfoo.bar.baz.
It wasn't clear to me that this was the way imports worked. Now that I know the following seems rather stupid:
import foo
import foo.bar
Is the single import clear enough for other programmers?