Defining extension modules — Python 3.14.7 documentation

docs.python.org

Tin mới

Exception Handling

Python Module Index

3.14.7 Documentation

Python/C API reference manual

importlib.machinery.ExtensionFileLoader

A C extension for CPython is a shared library (for example, a .so file on Linux, .pyd DLL on Windows), which is loadable into the Python process (for example, it is compiled with compatible compiler settings), and which

Multiple module instances¶

A C extension for CPython is a shared library (for example, a .so file on Linux, .pyd DLL on Windows), which is loadable into the Python process (for example, it is compiled with compatible compiler settings), and which

module.__package__

By default, Python itself creates the module object – that is, it does the equivalent of object.__new__() for classes. It also sets initial attributes like __package__ and __loader__.

Multiple module instances¶

By default, extension modules are not singletons. For example, if the sys.modules entry is removed and the module is re-imported, a new module object is created, and typically populated with fresh method and type objects

Multiple module instances¶

By default, extension modules are not singletons. For example, if the sys.modules entry is removed and the module is re-imported, a new module object is created, and typically populated with fresh method and type objects

Isolating Extension Modules

By default, extension modules are not singletons. For example, if the sys.modules entry is removed and the module is re-imported, a new module object is created, and typically populated with fresh method and type objects

Py_mod_multiple_interpreters

By default, extension modules are not singletons. For example, if the sys.modules entry is removed and the module is re-imported, a new module object is created, and typically populated with fresh method and type objects