See More

#include #include #include static PyObject * average(PyObject *self, PyObject *args){ PyObject * listObj; if (! PyArg_ParseTuple( args, "O!", &PyList_Type, &listObj)) return NULL; std::vector v; auto v_size=PyList_Size(listObj); v.reserve(v_size); for(auto i=0;i