Open victorgabillon opened 9 months ago
thanks for this amazing library!
Describe the bug It is not possible it seems to have the dataclass argument of the from_dict method to accept a union of class
To Reproduce
@dataclass class A: x: str
@dataclass class B: y: int
data = { 'y': 1 }
result = from_dict(data_class=A|B, data=data)
Expected behavior result woud be B(y=1)
Environment
dacite
thanks for this amazing library!
Describe the bug It is not possible it seems to have the dataclass argument of the from_dict method to accept a union of class
To Reproduce
@dataclass class A: x: str
@dataclass class B: y: int
data = { 'y': 1 }
result = from_dict(data_class=A|B, data=data)
Expected behavior result woud be B(y=1)
Environment
dacite
version: 1.8.1