diff --git a/src/python/pybind11/stats.cc b/src/python/pybind11/stats.cc index 1e6773f04a..f1b1e9c64e 100644 --- a/src/python/pybind11/stats.cc +++ b/src/python/pybind11/stats.cc @@ -132,6 +132,9 @@ pybind_init_stats(py::module_ &m_native) py::class_>( m, "Info") .def_readwrite("name", &Stats::Info::name) + .def_property_readonly("unit", [](const Stats::Info &info) { + return info.unit->getUnitString(); + }) .def_readonly("desc", &Stats::Info::desc) .def_readonly("id", &Stats::Info::id) .def_property_readonly("flags", [](const Stats::Info &info) {