picop.cymodule#
Module / import helpers.
- picop.cymodule.mod_add_cstr(module, name, value)#
Add string constant
nameviaPyModule_AddStringConstant.Notes
nameandvaluemust bebytes, notstr. Returns0on success; errors raise — do not use the status as a bool. Alias ofmod_add_string(prefer*_cstrnaming).
- picop.cymodule.mod_add_int(module, name, value)#
Add integer constant
nameviaPyModule_AddIntConstant.Notes
namemust bebytes. Returns0on success; errors raise — do not use the status as a bool.
- picop.cymodule.mod_add_object_ref(module, name, value)#
Add
valueasnamewithout stealing the reference (PyModule_AddObjectRef).Notes
namemust bebytes. Returns0on success; errors raise — do not use the status as a bool.
- picop.cymodule.mod_check(p)#
Return True if
pis a module or subtype (PyModule_Check). :type p:object:param p:- Return type:
- picop.cymodule.mod_check_exact(p)#
Return True if
type(p) is types.ModuleType(PyModule_CheckExact). :type p:object:param p:- Return type:
- picop.cymodule.mod_eq(a, b)#
Return True if
a is b(module-object identity; CPythonobject.__eq__). :type a:object:param a: :type b:object:param b:- Return type:
- picop.cymodule.mod_get_filename(module)#
Return
module.__file__viaPyModule_GetFilenameObject. :type module:object:param module:- Return type:
- picop.cymodule.mod_get_name(module)#
Return
module.__name__viaPyModule_GetNameObject. :type module:object:param module:- Return type:
- picop.cymodule.mod_import(name)#
Import module
nameviaPyImport_ImportModule.Notes
namemust bebytes, notstr.
- picop.cymodule.mod_import_object(name)#
Import module
nameviaPyImport_Import. :type name:object:param name:- Return type:
- picop.cymodule.mod_magic_number()#
Return the
.pycmagic number viaPyImport_GetMagicNumber.- Return type:
- picop.cymodule.mod_new(name)#
Return a new module named
nameviaPyModule_New.Notes
namemust bebytes, notstr.