konradhalas / dacite

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

Support PEP 604 unions, types.UnionType #184

Closed antonagestam closed 1 year ago

antonagestam commented 2 years ago

Fixes #180

This is essentially the same fix as this one: https://github.com/ilevkivskyi/typing_inspect/pull/83

idanmiara commented 2 years ago

Hi @konradhalas, Is this going to be merged for the next version?

Thanks @antonagestam

If only I spent a few minutes to check if that was already fixed before spending the time to fix it myself :( ... https://github.com/konradhalas/dacite/pull/189

anstadnik commented 1 year ago

Hi @konradhalas, I too stumbled upon this and spent a lot of time trying to fix things. What makes things harder is that if used in concurrent env, this error sometimes cause deadlocks, so it's easy to start searching in the wrong direction Hope you find time to merge this PR :)

ccwienk commented 1 year ago

I would also love to see a new version of dacite including this fix. dacite is currently keeping us from consistently using shorthand-typehints for optional attrs in dataclasses :-(

Sclafus commented 1 year ago

Hello, is this pull request still active? Just encountered an issue because of the issue mentioned.

konradhalas commented 1 year ago

@antonagestam thank you very much for your PR - good job! I'm sorry you had to wait so long.

antonagestam commented 1 year ago

@konradhalas No worries, thank you for merging this. OSS is free work and I have a lot of respect for the time it takes from people's lives. So, thanks again! 🙏