MCPcopy Create free account
hub / github.com/pybind/pybind11 / PYBIND11_EMBEDDED_MODULE

Function PYBIND11_EMBEDDED_MODULE

tests/test_with_catch/test_interpreter.cpp:70–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68};
69
70PYBIND11_EMBEDDED_MODULE(widget_module, m, py::multiple_interpreters::per_interpreter_gil()) {
71 py::class_<Widget, PyWidget>(m, "Widget")
72 .def(py::init<std::string>())
73 .def_property_readonly("the_message", &Widget::the_message);
74
75 m.def("add", [](int i, int j) { return i + j; });
76
77 auto sub = m.def_submodule("sub");
78 sub.def("add", [](int i, int j) { return i + j; });
79}
80
81PYBIND11_EMBEDDED_MODULE(trampoline_module, m) {
82 py::class_<test_override_cache_helper,

Callers 1

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected