I have a dataclass that can take values that are part of an enum.
class MyEnum(Enum):
A = "valueA"
B = "valueB"
@dataclass
class MyDataclass:
value: MyEnum
When creating my dataclass, the types don't match as it is considering str != MyEnum.A.
param = MyDataclass(value="valueA")
Any suggestion on how should MyDataclass be typed instead?
EDIT: The dataclass is being initialized with the string values I receive from another API