I'm working on a Python extension module written in C++.
According to the Python documentation the module method table should be written like this:
static PyMethodDef SpamMethods[] = {
...
{"system", spam_system, METH_VARARGS,
"Execute a shell command."},
...
{NULL, NULL, 0, NULL} /* Sentinel */
};
But I see that some developers write the sentinel like this:
static PyMethodDef SpamMethods[] = {
...
{"system", spam_system, METH_VARARGS,
"Execute a shell command."},
...
{} /* Sentinel */
};
My question is the following is there a risk to use the shortened version?