30 static std::list<std::function<void(py::module_ &)>> inits;
40 auto m = parent.def_submodule(submodule_name);
46 py::class_<ConstructorStats>(
m,
"ConstructorStats")
54 .def_static(
"get", (ConstructorStats &(*)(py::object)) &
ConstructorStats::get, py::return_value_policy::reference_internal)
58 .def_static(
"detail_reg_inst", []() {
66 m.doc() =
"pybind11 test module";
71 m.attr(
"debug_enabled") =
true;
73 m.attr(
"debug_enabled") =
false;
76 py::class_<UserType>(
m,
"UserType",
"A `py::class_` type for testing")
82 .def(
"__repr__", [](
const UserType& u) {
return "UserType({})"_s.format(u.value()); });
84 py::class_<IncType, UserType>(
m,
"IncType")
87 .def(
"__repr__", [](
const IncType& u) {
return "IncType({})"_s.format(u.value()); });