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

Function add_bindings

tests/test_methods_and_attributes.cpp:320–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318struct Field : FieldBase {};
319
320void add_bindings(py::module &m) {
321 py::module sm = m.def_submodule("exercise_is_setter");
322 // NOTE: FieldBase is not wrapped, therefore ...
323 py::class_<Field>(sm, "Field")
324 .def(py::init<>())
325 .def_property(
326 "int_value",
327 &Field::int_value,
328 &Field::SetIntValue // ... the `FieldBase &` return value here cannot be converted.
329 );
330}
331
332} // namespace exercise_is_setter
333} // namespace pybind11_tests

Callers 1

TEST_SUBMODULEFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected