Open Daraan opened 8 months ago
This seems like a niche use case that is unlikely to ever get supported unless someone who really needs it submits a complete PR for it. Also unless Boost.Python.enum
is a subclass of enum.Enum
this may require a lot of changes in the code (and if it is I'm not 100% sure how easy it'd be...)
Is your feature request related to a problem? Please describe. When an Enum is implemented in C++ and brought to Python via the
Boost.Python.enum
class is not supported like normal Enums despite being alike.flags=dict(allow_objects=True)
needs to be used to allow these Enum type hints, however there will then be no safeguarding and any value can be written into these fields. FurtherUnion
cannot used with them.Describe the solution you'd like
Boost.Python.enum
should possible as type like the standard Python EnumsA workaround is to construct a intermediate enum. One would need to reconstruct all enums by hand or use the functional approach:
However the functional approach does not allow for correct type hints here.