if (!func1.isCallable()) { PyErr_Format(PyExc_TypeError, "func1 is not a callable function"); return NULL; }