Closed developer992 closed 6 months ago
The purpose of a MultiValueEnum
is to have several different values that correspond to one enum member. In your WarningType2
if you tried WarningType2(WarningLevel.INFO
it would know if you wanted ONE
or THREE
.
It looks like what you really want are attributes:
class WarningType2(aenum.Enum):
_init_ = "value text level"
ONE = 1, "This is rule #1", WarningLevel.INFO
TWO = 2, "This is rule #2", WarningLevel.ERROR
THREE = 3, "This is rule #3", WarningLevel.INFO
and in use:
>>> WarningType2.TWO.level
WarningLevel.ERROR
oh didn't know that, thanks!
why wouldn't this work:
it fails here but i don't see why this is necessary constraint and further more, how do i get around it?
aenum/_enum.py:973:
Not even this works: