konradhalas / dacite

Simple creation of data classes from dictionaries.
MIT License
1.72k stars 106 forks source link

What about basic types involving dataclasses #166

Closed razaqq closed 2 years ago

razaqq commented 2 years ago

the current of from_dict(data_class=Class, data=data) does not support basic types involving dataclasses

in many cases it would be very useful to be able to do the following: from_dict(data_class=List[Class], data=data) from_dict(data_class=Dict[str, Class], data=data)

Would that be possible to support?

Vad1mo commented 2 years ago

yes converting to and from list would be nice thing

konradhalas commented 2 years ago

Hi @razaqq - thank you for your suggestion.

TBH I really want to keep dacite API as simple as possible. You can always iterate over your data and call from_dict multiple times.