pytype
pytype copied to clipboard
Error when calling isinstance with TypeVar
import typing
def test(x) -> bool:
return isinstance(x, typing.TypeVar)
This produces an unexpected error:
File "/home/elt/code/pytype-test/proj/type_var.py", line 4, in test: Built-in function isinstance was called with the wrong arguments [wrong-arg-types]
Expected: (object, class_or_type_or_tuple: Union[Tuple[Union[Tuple[type, ...], type], ...], type])
Actually passed: (object, class_or_type_or_tuple: type)
For the reference, this works in mypy.