3.9. Module API#

PyModuleDef CpModule;#

Global module object for the Caterpillar C module.

inline _modulestate *get_module_state(PyObject *module)#

Returns the _modulestate for the given module.

inline _modulestate *get_global_module_state(void)#

Returns the _modulestate using the global caterpillar module object.

struct _modulestate#

The internal state for this module. It will store all necessary information about the core module.

TODO

CpModule_SetupType(op)#

Sets up the type object for the given module object. Expands to:

if (PyType_Ready(op) < 0)
    return NULL;