Add __int__
dunder to enums if the underlying type is_integral
#985
-
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
It doesn't seem to work in Python either:
|
Beta Was this translation helpful? Give feedback.
-
Apologies for not giving an immediately compilable example; on mobile at the moment.
In python, with the above bindings, you can do If this update is done we would want to update the type stubs to have the class be |
Beta Was this translation helpful? Give feedback.
Does nanobind behave as you would want if you specify
nb::is_arithmetic()
?See: https://nanobind.readthedocs.io/en/latest/classes.html#enumerations-and-internal-types