誰かがPythonインタープリターでのこの動作に光を当ててください:
from os import path # success
type(path) # <class 'module'>
from path import * # complains that no module called 'path' exists
type(os.path) # complains that the name 'os' is not defined, yet:
from os.path import * # works just fine
副次的な質問として、「from os import path」などのステートメントが機能することを可能にするメカニズムは何ですか?それでも os は未定義ですか? os は from...import の時点で実行されるのではないので、モジュールとして「認識」する必要がありますか? os を既知の名前から除外するのは、('import os' のように) 直接インポートされていないシンボルで名前空間が「汚染」されるのを防ぐための単なる規則であると言うのは正しいでしょうか?