sys.modules mapping serves as a cache of all modules that have been
previously imported, including the intermediate paths. So if
foo.bar.baz was previously imported, sys.modules will contain entries
for foo, foo.bar, and foo.bar.baz. Each key will have as its value the
corresponding module object.
当任何python包被导入时,它的
__init__.py
文件被隐式执行,并且额外的绑定被添加到sys.modules
中。你知道吗就像导入python
requests
包一样,下面的条目被添加到sys.modules
相关问题 更多 >
编程相关推荐