-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
topic: ioI/O related issuesI/O related issues
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
Metadata
Metadata
Assignees
Labels
topic: ioI/O related issuesI/O related issues