python.cooked

Helper functions to interact with the Python C API

Members

Functions

addIntConstant
void addIntConstant(PyObject* module_)
Undocumented in source. Be warned that the author may not have intended to support it.
addModuleTypes
void addModuleTypes(PyObject* module_)

Takes a variadic sequence of D aggregate types and adds equivalent Python types to the passed-in module.

addStringConstant
void addStringConstant(PyObject* module_)
Undocumented in source. Be warned that the author may not have intended to support it.
createModule
auto createModule()

Creates a Python3 extension module from the given C functions, which must be of type PyObject* (PyObject* args, PyObject* kwargs). kwargs is optional. The aggregates are the D structs/classes/enums to be wrapped.

pyMethodDef
auto pyMethodDef(F cfunction)

Helper function to create PyMethodDef structs. The strings are compile-time parameters to avoid passing GC-allocated memory to Python (by calling std.string.toStringz or manually appending the null terminator).

Manifest constants

defaultMethodFlags
enum defaultMethodFlags;
Undocumented in source.

Meta