You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Jupyter Notebook or in IPython I can normally press tab inside a function to autocomplete named arguments, but I cannot make this work for the example below. I can explicitly name the arguments, i.e. add(first=2, second=3) but not begin typing sec...+tab to complete to second. Is there a way of achieve this?
Reproducible example code
#include<pybind11/pybind11.h>intadd(int i, int j) {
return i + j;
}
namespacepy= pybind11;
PYBIND11_PLUGIN(example) {
usingnamespacepybind11::literals;
py::module m("example", "pybind11 example plugin");
m.def("add", &add, "A function which adds two numbers", "first"_a, "second"_a);
return m.ptr();
}
The text was updated successfully, but these errors were encountered:
Currently, IPython can't get argument names from pybind11 functions (some other tools can get this information by parsing docstrings, but it doesn't look like IPython does that). This should be resolved by #945 which would allow IPython to inspect the function signature.
Thanks for looking into this - I'll watch #945. Signature inspection / argument completion is in my case key for writing a python interface as it mostly eliminates the need for external documentation.
Issue description
In Jupyter Notebook or in IPython I can normally press tab inside a function to autocomplete named arguments, but I cannot make this work for the example below. I can explicitly name the arguments, i.e.
add(first=2, second=3)
but not begin typingsec...
+tab to complete tosecond
. Is there a way of achieve this?Reproducible example code
The text was updated successfully, but these errors were encountered: