Lines Matching refs:py

18     // test_local_bindings.py tests:
21 // relevant pybind11_tests submodule from a test_whatever.py
24 bind_local<ExternalType1>(m, "ExternalType1", py::module_local());
25 bind_local<ExternalType2>(m, "ExternalType2", py::module_local());
27 // test_exceptions.py
28 m.def("raise_runtime_error", []() { PyErr_SetString(PyExc_RuntimeError, "My runtime error"); throw py::error_already_set(); });
29 m.def("raise_value_error", []() { PyErr_SetString(PyExc_ValueError, "My value error"); throw py::error_already_set(); });
30 m.def("throw_pybind_value_error", []() { throw py::value_error("pybind11 value error"); });
31 m.def("throw_pybind_type_error", []() { throw py::type_error("pybind11 type error"); });
32 m.def("throw_stop_iteration", []() { throw py::stop_iteration(); });
34 // test_local_bindings.py
36 bind_local<LocalType, 1>(m, "LocalType", py::module_local())
51 // stl_bind.h binders defaults to py::module_local if the types are local or converting:
52 py::bind_vector<LocalVec>(m, "LocalVec");
53 py::bind_map<LocalMap>(m, "LocalMap");
59 py::bind_vector<NonLocalVec>(m, "NonLocalVec");
62 py::bind_map<NonLocalMap>(m, "NonLocalMap");
64 // The default can, however, be overridden to global using `py::module_local()` or
65 // `py::module_local(false)`.
67 py::bind_vector<NonLocalVec2>(m, "NonLocalVec2", py::module_local());
70 py::bind_map<NonLocalMap2>(m, "NonLocalMap2", py::module_local(false));
77 bind_local<MixedGlobalLocal, 200>(m, "MixedGlobalLocal", py::module_local());
80 bind_local<MixedLocalGlobal, 2000>(m, "MixedLocalGlobal", py::module_local(false));
86 m.def("local_cpp_types_addr", []() { return (uintptr_t) &py::detail::registered_local_types_cpp(); });
89 py::bind_vector<std::vector<int>>(m, "VectorInt");
100 py::class_<pets::Pet>(m, "Pet", py::module_local())
103 py::class_<Dog, pets::Pet>(m, "Dog")
104 .def(py::init<std::string>());
107 py::class_<MixGL>(m, "MixGL", py::module_local()).def(py::init<int>());
110 py::class_<MixGL2>(m, "MixGL2", py::module_local()).def(py::init<int>());
115 // is defined here and tested in `test_stl_binders.py`.
116 py::bind_vector<std::vector<bool>>(m, "VectorBool");