Open github-actions[bot] opened 2 years ago
Update typeshed to make Union[X, Y]
return something unique instead of object
. Then update the type annotation on issubform
to include that.
Maybe this is a basedmypy issue. The problem is that Union
is just an instance of _SpecialForm
, and we don't have any concept of an 'instance type'. Union[X]
returns an instance of a _UnionGenericAlias
, but that's not something that we want to expose I think, and we couldn't anyway without the aforementioned instance type.
I suggest, in the lack of instance type support, we special case it in basedmypy.
Unless we like, and say that _SpecialForm
is generic, then we could keep track of it's type!
https://github.com/KotlinIsland/basedtyping/blob/997af522c978e0a5254cfcfe0ab3070219f432ab/tests/test_is_subform.py#L21
31dba085975f5e1e859c0c7c076f040fd35ce713