mirror of
https://github.com/pybind/pybind11.git
synced 2026-05-11 17:00:34 +00:00
Only support ==/!= int on unscoped enums
This makes the Python interface mirror the C++ interface: pybind11-exported scoped enums aren't directly comparable to the underlying integer values.
This commit is contained in:
@@ -12,6 +12,8 @@ test_function(enum=2)
|
||||
None
|
||||
test_ecenum(ECMyEnum::Three)
|
||||
test_ecenum(ECMyEnum::Two)
|
||||
Good: caught expected TypeError exceptions for scoped enum ==/!= int comparisons
|
||||
Good: no TypeError exception for unscoped enum ==/!= int comparisions
|
||||
enum->integer = 2
|
||||
integer->enum = EMyEnumeration.ESecondEntry
|
||||
A constant = 14
|
||||
|
||||
Reference in New Issue
Block a user