- Notifications
You must be signed in to change notification settings - Fork184
Creating anIntEnum programmatically#1577
-
I have an integer range that I want to encode so that the encoding begins at zero. I used an fromenumimportIntEnumaspyIntEnumsum_range=range(4,21+1)SumEnum=pyIntEnum('SumEnum', {f'SUM_{x}':x-4forxinsum_range})display(type(SumEnum))# enum.EnumTypefromamaranth.lib.enumimportIntEnumasamaranthIntEnumSumEnum=amaranthIntEnum('SumEnum',names={f'SUM_{x}':x-4forxinsum_range},shape=unsigned(5))# TypeError: EnumType.__call__() got an unexpected keyword argument 'shape' What would be the right way to create an Enum programmatically? I am new to Amaranth, so an alternative Amarantish approach is also welcome. |
BetaWas this translation helpful?Give feedback.
All reactions
Answered by whitequarkApr 18, 2025
This is a known bug:#1535
I think if you ask in the IRC/Matrix channel, someone might help you out with it.
Replies: 1 comment
-
This is a known bug:#1535 I think if you ask in the IRC/Matrix channel, someone might help you out with it. |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
0 replies
Answer selected bygoekce
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment