-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Union argument leads to error #392
Comments
This also fails when using What works, is either using just |
Oh, I think I need to handle the type annotations a little smarter than I currently do. I'll take a look at this and see how to fix it. |
Seems to be a Python problem which is better handled in py38 - if you want to support py36 onwards, have a look at https://stackoverflow.com/a/45959000/818131 |
Thanks for that SO answer! That provides the clues that are needed to make this type annotation viable. |
Since |
Should be fixed in 0.44.1 which I just deployed: https://pypi.org/project/django-unicorn/0.44.1/. |
When having a Union argument type, or Python's new-style 'or' argument type "|", Unicorn crashes. Given the following code:
When you cal my_method from the client, Unicorn crashes:
This is because
argument
is UnionType here, says the debugger:So I suppose this could be done better...?
The text was updated successfully, but these errors were encountered: