Also:

1) When you create a C array to map python names to the C functions
that you defined:

static PyMethodDef MyFunctions[] =
{
    {"my_calc", (PyCFunction)my_func, METH_VARARGS, "my very speedy c
function"},
    {NULL, NULL, 0, NULL}
};

Why do you need to cast my_func to PyCFunction?


2) When returning None, why use the idiom:

Py_INCREF(Py_None);
return Py_None;

instead of:

return Py_BuildValue("");

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to