ilevkivskyi / typing_inspect

Runtime inspection utilities for Python typing module
MIT License
350 stars 35 forks source link

BUG: is_union_type return None sometime #96

Open samsja opened 1 year ago

samsja commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Hey here is the PR : https://github.com/ilevkivskyi/typing_inspect/pull/97