Module Objects — Python 3.9.25 documentation

docs.python.org

Tin mới

Python documentation for the current stable release

Python documentation for the current stable release

This instance of PyTypeObject represents the Python module type. This is exposed to Python programs as types.ModuleType.

Python Module Index

3.9.25 Documentation

Python/C API Reference Manual

Concrete Objects Layer

PyImport_AppendInittab()

Modules objects are usually created from extension modules (shared libraries which export an initialization function), or compiled-in modules (where the initialization function is added using PyImport_AppendInittab()). S

Building C and C++ Extensions

Modules objects are usually created from extension modules (shared libraries which export an initialization function), or compiled-in modules (where the initialization function is added using PyImport_AppendInittab()). S

Extending Embedded Python

Modules objects are usually created from extension modules (shared libraries which export an initialization function), or compiled-in modules (where the initialization function is added using PyImport_AppendInittab()). S

PyTypeObject.tp_clear

A clear function to call during GC clearing of the module object, or NULL if not needed.

Multi-phase initialization¶

An alternate way to specify extensions is to request “multi-phase initialization”. Extension modules created this way behave more like Python modules: the initialization is split between the creation phase, when the modu

Multi-phase initialization¶

An alternate way to specify extensions is to request “multi-phase initialization”. Extension modules created this way behave more like Python modules: the initialization is split between the creation phase, when the modu

Multi-phase initialization¶

An alternate way to specify extensions is to request “multi-phase initialization”. Extension modules created this way behave more like Python modules: the initialization is split between the creation phase, when the modu

Multi-phase initialization¶

An alternate way to specify extensions is to request “multi-phase initialization”. Extension modules created this way behave more like Python modules: the initialization is split between the creation phase, when the modu

importlib.machinery.ModuleSpec

Specifies a function that is called to create the module object itself. The value pointer of this slot must point to a function of the signature: