擬似コード理解pythonのimport

804 ワード

A.py
from B import D
class C 

  
_G["modules"]["A"] = dict()

if "B" not in _G["modules"]:
    compile B (     B.py        )
D = _G["modules"]["B"]["D"]

_G["modules"]["A"]["C"] = class

  
A.py
import B
class C 

  
_G["modules"]["A"] = dict()

if "B" not in _G["modules"]:
    _G["modules"]["B"] = dict()

_G["modules"]["A"]["C"] = class

------------------
B.py
from A import C
class D 

  
_G["modules"]["B"] = dict()

if "A" not in _G["modules"]:
    compile A (     A.py        )
C = _G["modules"]["A"]["C"]

_G["modules"]["B"]["D"] = class