I have a simple example c extension for Python (CPython 3.9), based on this Stack Overflow answer. I can access this from python via the function help(_myexample)
, but the question is: Is there a way to display the docstring (foo_doc) on hover, such as provided by Microsoft's Python extension for vscode for standard Python docstrings?
static PyObject* foo(PyObject *self, PyObject *args) {
/* blabla [...] */
}
PyDoc_STRVAR(
foo_doc,
"foo(timeout, flags=None, /)\n"
"--\n"
"\n"
"Great example function\n"
"Arguments: (timeout, flags=None)\n"
"Doc blahblah doc doc doc.");
static PyMethodDef methods[] = {
{"foo", foo, METH_VARARGS, foo_doc},
{NULL},
};
PyMODINIT_FUNC init_myexample(void) {
(void) Py_InitModule3("_myexample", methods, "a simple example module");
}