Question about modules documentation
In this doc:
Near the top it states:
Modules can import other modules. It is customary but not
required to place all import statements at the beginning
of a module (or script, for that matter). The imported
module names are placed in the importing module?s global
When it refers to 'the imported module names' it sounds as though
it is referring to the top level variables and functions in the
imported module. This is not the case as far as I can tell.
If bar.py has a function bar() and in foo.py I do:
of course this fails. I have to do:
I know it would work if I went:
from bar import *
but that feature is only introduced in the next section
of the doc.
It seems that if the statement read:
the imported module's name (singular) is placed in the
importing module's global symbol table.
That it would be more accurate.