According to the docs, an argument typed as bytes should also accept bytearray and memoryview, but this doesn't seem to be the case.
The following example demonstrates this:
def process(b: bytes) -> None:
pass
process(memoryview(b"foo"))
Mypy produces the following error:
error: Argument 1 to "process" has incompatible type "memoryview"; expected "bytes"
I found #4871 which is essentially the same issue. If there hasn't been any relevant changes since April 2008, perhaps its a docs issue only?
According to the docs, an argument typed as
bytesshould also acceptbytearrayandmemoryview, but this doesn't seem to be the case.The following example demonstrates this:
Mypy produces the following error:
I found #4871 which is essentially the same issue. If there hasn't been any relevant changes since April 2008, perhaps its a docs issue only?