I have the following code
import io
def reader(byte_stream: io.BufferedIOBase):
...
reader(open("./README.md", "rb"))
When I run this file through mypy, I get the following type error:
subclass.py:6:8: error: Argument 1 to "reader" has incompatible type "BinaryIO"; expected "BufferedIOBase" [arg-type]
reader(open("./README.md", "rb"))
^
Found 1 error in 1 file (checked 1 source file)
This should not be an error though, as BinaryIO inherits from BufferedIOBase, which I have verified here:
isinstance(open("./README.md", "rb"), io.BufferedIOBase) # True
So, what is wrong with my type signature?