I have an enum that should be something like this:
from enum import Enum
class ComponentType(Enum):
5120 = "<{}b"
5121 = "<{}B"
5122 = "<{}h"
5123 = "<{}H"
5125 = "<{}I"
5126 = "<{}f"
Obviously, this doesn't work because you can't assign to a literal. How would I go about creating and using an enum from this data? I have an integer that needs to pair with a format for struct.unpack(). I know this can be done with a dictionary, can it be done with an enum? What would it look like?