You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From a user's perspective, this caused surprise for a project where we weren't using bitwise features of enums and had Python code making decisions based on whether values were iterable. After this change, our enumerations suddenly became iterable and things broke (vapoursynth/vapoursynth#1046).
It's understandable why the switch to IntFlag was made and we've worked around it but I would love if you could optionally signal plain IntEnum behavior outside of C++ context.
It probably isn't too a hard to implement from a code-gen point of view it's just a case of finding a nice syntax. Probably just a decorator on cpdef enum?
We're obviously slightly at the mercy of what CPython decides to do with their enums. IntFlag wasn't actually iterable until 3.11 (which is admittedly after we started using it) so this change to behaviour is only partly of our own doing.
I'm not hugely convinced it's worth the extra complication right now.
The text was updated successfully, but these errors were encountered:
From a user's perspective, this caused surprise for a project where we weren't using bitwise features of enums and had Python code making decisions based on whether values were iterable. After this change, our enumerations suddenly became iterable and things broke (vapoursynth/vapoursynth#1046).
It's understandable why the switch to
IntFlag
was made and we've worked around it but I would love if you could optionally signal plainIntEnum
behavior outside of C++ context.Originally posted by @JustinTArthur in #4877 (comment)
DW's notes:
It probably isn't too a hard to implement from a code-gen point of view it's just a case of finding a nice syntax. Probably just a decorator on
cpdef enum
?We're obviously slightly at the mercy of what CPython decides to do with their enums.
IntFlag
wasn't actually iterable until 3.11 (which is admittedly after we started using it) so this change to behaviour is only partly of our own doing.I'm not hugely convinced it's worth the extra complication right now.
The text was updated successfully, but these errors were encountered: