Open
Description
mypy test.py
test.py:10: error: Argument 1 to "test" has incompatible type "BinaryIO"; expected "BufferedIOBase"
cat test.py
import io
import sys
class C(io.BufferedIOBase):
pass
def test(c: io.BufferedIOBase):
assert isinstance(c, io.BufferedIOBase)
test(sys.stdout.buffer)
test(C())
python3 test.py
As we can see the isinstance check passes but mypy asserts