mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-24 23:07:00 +00:00
enum: add missing Enum.value property (#2739)
* enum: Add Enum.value property * simplify * address review
This commit is contained in:
@@ -1731,6 +1731,7 @@ public:
|
||||
m_base.init(is_arithmetic, is_convertible);
|
||||
|
||||
def(init([](Scalar i) { return static_cast<Type>(i); }), arg("value"));
|
||||
def_property_readonly("value", [](Type value) { return (Scalar) value; });
|
||||
def("__int__", [](Type value) { return (Scalar) value; });
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
def("__long__", [](Type value) { return (Scalar) value; });
|
||||
|
||||
Reference in New Issue
Block a user