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

BUG: is_union_type return None sometime #96

Open
samsja opened this issue Jan 5, 2023 · 2 comments
Open

BUG: is_union_type return None sometime #96

samsja opened this issue Jan 5, 2023 · 2 comments
Labels

Comments

@samsja
Copy link

samsja commented Jan 5, 2023

Hey I think I found a bug

from typing_inspect import is_union_type
print(is_union_type(int))
>>> None

I believe is_union_type should always return a bool, and in this case it should return False

@ilevkivskyi
Copy link
Owner

Yeah. Should be an easy fix, left operand here https://github.com/ilevkivskyi/typing_inspect/blob/master/typing_inspect.py#L232 should be MaybeUnionType is not None instead of plain MaybeUnionType. PRs are welcome!

@samsja
Copy link
Author

samsja commented Jan 5, 2023

Hey here is the PR : #97

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

No branches or pull requests

2 participants