konradhalas / dacite

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

Non-dict objects in collection with dataclasses no longer throw an error #17

Closed bpeake-illuscio closed 5 years ago

bpeake-illuscio commented 5 years ago

Fixes https://github.com/konradhalas/dacite/issues/16

Right now any non-dict objects are passed when loading items for a collection. This may or may not be desire-able. It allows more lenient unions, but may fail some of the type-checking goals of the lib.

It also means dicts OTHER than dict representations of a dataclass in a collection will not be passed. This COULD be an issue if you had a collection of both lists and dataclasses.

These are both edge-cases and can likely be safely ignored until someone needs them implemented.

konradhalas commented 5 years ago

@bpeake-illuscio thank you very much for all your issues and PRs - I start reviewing them :)

konradhalas commented 5 years ago

I fixed it in 4a4b9f4db4d10bb119c03ca8f100f4caddda40ac with a bit simpler way. Should work in your case :)

bpeake-illuscio commented 5 years ago

Awesome, thanks so much!