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:
Jason Rhinelander
2016-08-04 00:21:37 -04:00
parent 613541947a
commit d41a273031
3 changed files with 29 additions and 3 deletions

View File

@@ -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