python_to_d

This converts a PyObject* to a D type. The template argument is the type to convert to. The function argument is the PyObject* to convert. For instance:

*$(D_CODE PyObject* i = PyInt_FromLong(20); *int n = _python_to_d!(int)(i); *assert(n == 20);)

This throws a PydConversionException if the PyObject can't be converted to the given D type.

T
python_to_d
(
T
)

Meta