diff --git a/include/pybind/pybind.h b/include/pybind/pybind.h index 666cd69d0..495311648 100644 --- a/include/pybind/pybind.h +++ b/include/pybind/pybind.h @@ -812,6 +812,7 @@ public: ((it == entries->end()) ? std::string("???") : std::string(it->second)); }); + this->def("__int__", [](Type value) { return (int) value; }); m_entries = entries; }