Closed sinback closed 4 years ago
Hi @sinback - thank you for PR :)
I like it, It makes sense, but let me think about it for a while. Union
is a tricky type. TBH it should be banned ;)
I had to make a few minor amendments, but it's now in master
branch 🎉 Check ff3f5fc2b5c0065cafeaf3c6be8b453b70a05086. Thank you for your contribution!
Hi. I'm not sure if this feature is desired in dacite, but we patched our own fork of dacite to have it since it helps our team feel a little saner when resolving polymorphic union types. Let me know if you have comments or requests.
Add a config flag, no_ambiguous_resolution, to raise an error if a dacite dataclass construction is being performed on a datatype which can be resolved multiple ways.
I added a test also which demonstrates the situation that this flag can help catch.