Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make from_dict accept data with Mapping type instead of Dict #92

Closed
igorcoding opened this issue May 7, 2020 · 2 comments · Fixed by #208
Closed

Make from_dict accept data with Mapping type instead of Dict #92

igorcoding opened this issue May 7, 2020 · 2 comments · Fixed by #208
Labels
enhancement New feature or request

Comments

@igorcoding
Copy link

Hello!

In my projects I often use dacite with objects that were returned from functions with Mapping[str, Any] in return annotation or MutableMapping[str, Any] which clashes with the from_dict signature that expects a Dict[str, Any] as a data type, and therefore forces to use typing.cast(dict, obj) every time.

Is it necessary to use a Dict as data type?

Thanks.

@konradhalas
Copy link
Owner

Hi @igorcoding - thank you for reporting this issue :)

OFC you have right and it makes sense, I'll change it.

@igorcoding
Copy link
Author

Awesome! Thank you!

@konradhalas konradhalas added the enhancement New feature or request label Jul 3, 2020
daiwt added a commit to daiwt/dacite that referenced this issue Sep 16, 2021
idanmiara pushed a commit to idanmiara/dacite that referenced this issue Nov 30, 2022
idanmiara pushed a commit to idanmiara/dacite that referenced this issue Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants