Skip to content

Commit

Permalink
Set and import the __doc__ property as well (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhbell authored Jun 12, 2024
1 parent 9ce9ba9 commit 58bf917
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/nanobind_example/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .nanobind_example_ext import add
from .nanobind_example_ext import add, __doc__
1 change: 1 addition & 0 deletions src/nanobind_example_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ namespace nb = nanobind;
using namespace nb::literals;

NB_MODULE(nanobind_example_ext, m) {
m.doc() = "This is a \"hello world\" example with nanobind";
m.def("add", [](int a, int b) { return a + b; }, "a"_a, "b"_a);
}

0 comments on commit 58bf917

Please sign in to comment.