Parameterized Enums in Python
In Python, I want to have an enum-like data structure that can be used like the Option
enum in Rust: the enum has parameterized member, and an unparameterized, e.g.,
Is there a way to enforce the number of members an enum is allowed to have?
Making an enum with exactly n many members is trivial if I’ve defined it myself:
iterate over IntFlag enumeration using iter differs in python 3.8 and 3.12.4
I have the following working in python 3.8.1
Creating an enum with members whose attributes can be initialized
From this answer I learned how to create an enum with attributes (i.e. additional data):