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

Support PEP 604 unions, types.UnionType #184

Merged

Conversation

antonagestam
Copy link
Contributor

@antonagestam antonagestam commented Jun 7, 2022

Fixes #180

This is essentially the same fix as this one: ilevkivskyi/typing_inspect#83

Copy link

@jodal jodal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After patching some other APIs to work with PEP 604 union types, this fix looks correct to me.

@idanmiara
Copy link

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 :( ...
#189

@anstadnik
Copy link

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
Copy link

ccwienk commented Oct 21, 2022

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
Copy link

Sclafus commented Nov 28, 2022

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

@konradhalas konradhalas merged commit 6e61433 into konradhalas:master Dec 19, 2022
@konradhalas
Copy link
Owner

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

@antonagestam antonagestam deleted the fix/handle-pep-604-union-type branch December 19, 2022 19:24
@antonagestam
Copy link
Contributor Author

@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! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Union operator doesn't work for nested dataclasses (Python 3.10)
7 participants