Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocompletion for named arguments in Jupyter Notebook / IPython #990

Closed
mlund opened this issue Aug 8, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@mlund
Copy link

commented Aug 8, 2017

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 typing sec...+tab to complete to second. Is there a way of achieve this?

Reproducible example code

#include <pybind11/pybind11.h>
int add(int i, int j) {
    return i + j;
}
namespace py = pybind11;
PYBIND11_PLUGIN(example) {
    using namespace pybind11::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();
}
@dean0x7d

This comment has been minimized.

Copy link
Member

commented Aug 12, 2017

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.

@mlund

This comment has been minimized.

Copy link
Author

commented Aug 22, 2017

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.

@mlund mlund closed this Aug 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.