support docstrings in enum::value() (#1160)

This commit is contained in:
Wenzel Jakob
2017-11-16 22:24:36 +01:00
committed by GitHub
parent 0a0758ce3a
commit 6d19036cb2
4 changed files with 43 additions and 9 deletions

View File

@@ -15,9 +15,9 @@ TEST_SUBMODULE(enums, m) {
EOne = 1,
ETwo
};
py::enum_<UnscopedEnum>(m, "UnscopedEnum", py::arithmetic())
.value("EOne", EOne)
.value("ETwo", ETwo)
py::enum_<UnscopedEnum>(m, "UnscopedEnum", py::arithmetic(), "An unscoped enumeration")
.value("EOne", EOne, "Docstring for EOne")
.value("ETwo", ETwo, "Docstring for ETwo")
.export_values();
// test_scoped_enum