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 for union of None like Optional #77

Closed
samsja opened this issue Jan 17, 2024 · 3 comments
Closed

support for union of None like Optional #77

samsja opened this issue Jan 17, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@samsja
Copy link

samsja commented Jan 17, 2024

Hey, thanks for the great lib.

I think that currently Optional[int] is supported but not int | None which should be equivalent.

Would it be possible to support it ?

thanks in advance

@BrianPugh BrianPugh added the bug Something isn't working label Jan 17, 2024
@BrianPugh
Copy link
Owner

Thanks for the bug report! Fixing now. I mostly code in python3.8 syntax (until it reaches EOL), so I didn't notice this issue.

The problem at heart is basically described in python/cpython#105499

@BrianPugh
Copy link
Owner

Should be fixed in v2.1.1

@samsja
Copy link
Author

samsja commented Jan 18, 2024

Thanks for the ultra quick fix ! Just updated to the latest version and it is working.

The problem at heart is basically described in python/cpython#105499

okay this is really weird problem that Union and | don't have the same behavior, very counterintuitive but good to know 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants