mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-19 22:39:09 +00:00
Avoid conversion to int_ rhs argument of enum eq/ne (#1912)
* fix: Avoid conversion to `int_` rhs argument of enum eq/ne * test: compare unscoped enum with strings * suppress comparison to None warning * test unscoped enum arithmetic and comparision with unsupported type
This commit is contained in:
committed by
Wenzel Jakob
parent
f6c4c1047a
commit
09f0829401
@@ -13,11 +13,13 @@ TEST_SUBMODULE(enums, m) {
|
||||
// test_unscoped_enum
|
||||
enum UnscopedEnum {
|
||||
EOne = 1,
|
||||
ETwo
|
||||
ETwo,
|
||||
EThree
|
||||
};
|
||||
py::enum_<UnscopedEnum>(m, "UnscopedEnum", py::arithmetic(), "An unscoped enumeration")
|
||||
.value("EOne", EOne, "Docstring for EOne")
|
||||
.value("ETwo", ETwo, "Docstring for ETwo")
|
||||
.value("EThree", EThree, "Docstring for EThree")
|
||||
.export_values();
|
||||
|
||||
// test_scoped_enum
|
||||
|
||||
Reference in New Issue
Block a user