跳到主要内容

ModulePlaceholder

私有源码

bdict_view = ModulePlaceholder(
name: str,
doc: str | None = None
)

占位符模块。

在某个模块无法找到时,使用该模块作为占位符。在此情况下,占位符仍然能提供__name__属性,但无法提供__spec__属性。

危险

该类仅在内部使用。用户不应使用它。

若用户希望检查某个模块是否是占位符,请使用fsc.backends.is_module_invalid

参数

参数类型必选
说明
namestr模块名。该值会传递给基类ModuleType
docstr | None占位符模块的 docstring。