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.
Modules created using the C API are typically defined using an array of PySlot structs, which provides a “description” of how a module should be created. See Definition slots for more information on slots in general.
Modules created using the C API are typically defined using an array of PySlot structs, which provides a “description” of how a module should be created. See Definition slots for more information on slots in general.
importlib.machinery.ModuleSpec
Slot ID for the name of the new module, as a NUL-terminated UTF8-encoded const char *.
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.
Slot ID for a traversal function to call during GC traversal of the module object.
Each module may have an associated token: a pointer-sized value intended to identify of the module state’s memory layout. This means that if you have a module object, but you are not sure if it “belongs” to your extensio
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().