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
Closed

Autocompletion for named arguments in Jupyter Notebook / IPython #990

mlund opened this issue Aug 8, 2017 · 2 comments

Comments

@mlund
Copy link

mlund 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
Copy link
Member

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
Copy link
Author

mlund 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants