模块对象 ¶
-
PyTypeObject
PyModule_Type
¶
-
属于
稳定 ABI (应用程序二进制接口)
.
此实例的
PyTypeObject表示 Python 模块类型。暴露这给 Python 程序作为types.ModuleType.
-
int
PyModule_Check
(
PyObject
*
p
)
¶
-
返回 True 若 p is a module object, or a subtype of a module object. This function always succeeds.
-
int
PyModule_CheckExact
(
PyObject
*
p
)
¶
-
返回 True 若 p 是模块对象,但不是子类型的
PyModule_Type. This function always succeeds.
-
PyObject
*
PyModule_NewObject
(
PyObject
*
名称
)
¶
-
返回值:新引用。
属于
稳定 ABI (应用程序二进制接口)
since version 3.7.
Return a new module object with
module.__name__设为 name 。模块的__name__,__doc__,__package__and__loader__属性被填充(除了__name__被设为None). The caller is responsible for setting a__file__属性。返回
NULLwith an exception set on error.Added in version 3.3.
3.4 版改变:
__package__and__loader__are now set toNone.