This does not apply to Python 3, you will have the same problem in Python 2. Importing a name adds it to the namespace, nothing more.
This line:
from path import *
Funds:
"Try to find a module called path in any directory that is in PYTHONPATH and try to import all the names from it into the current Namespace."
Since there is no such module in the current working directory and, more importantly, not in any directory that is located in PYTHONPATH , import is not performed. Please note: the search does not look for subdirectories of any directory located in PYTHONPATH .
type(os.path)
This line fails because there is no os name in the current namespace (since it is not imported).
Interestingly, what is a mechanism that allows, for example, to say "from os import path ', but still os undefined?"
Import invokes a search for paths that are defined in PYTHONPATH to search for modules; see this effect article for more details on how imports work.
"Undefined" simply means that the name does not exist in the namespace.
Is os not running during import from ... and should it be "known" as a module?
No, when you do from x import y , only y imported, not x .
I have the right to say that preserving os from known names is just a convention designed to prevent "pollution" of the namespace with characters that were not imported directly (as in 'import os')?
No, this is not true (and I hope you understand why).