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()); });
int default_constructions
std::list< std::function< void(py::module &)> > & initializers()
PYBIND11_NOINLINE internals & get_internals()
Return a reference to the current internals data.
void(*)(py::module &) Initializer
std::unordered_multimap< const void *, instance * > registered_instances
PYBIND11_MODULE(pybind11_tests, m)
test_initializer(Initializer init)
static ConstructorStats & get()
detail::initimpl::constructor< Args... > init()
Binds an existing constructor taking arguments Args...
void bind_ConstructorStats(py::module &m)