Tin mới
Return a new module object with module.__name__ set to name. The module’s __name__, __doc__, __package__ and __loader__ attributes are filled in (all but __name__ are set to None). The caller is responsible for setting a
Deprecated since version 3.2: PyModule_GetFilename() raises UnicodeEncodeError on unencodable filenames, use PyModule_GetFilenameObject() instead.
The functions in the previous section work on any module object, including modules imported from Python code.
A clear function to call during GC clearing of the module object, or NULL if not needed.
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:
The module supports being imported in subinterpreters, but only when they share the main interpreter’s GIL. (See Isolating Extension Modules.)
The module depends on the presence of the global interpreter lock (GIL), and may access global state without synchronization.
Add an object to module as name. This is a convenience function which can be used from the module’s initialization function.
Add an object to module as name. This is a convenience function which can be used from the module’s initialization function.
Attaches the module object passed to the function to the interpreter state. This allows the module object to be accessible via PyState_FindModule().