-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
false-positivemypy gave an error on correct codemypy gave an error on correct codegood-first-issuepriority-1-normal
Description
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
false-positivemypy gave an error on correct codemypy gave an error on correct codegood-first-issuepriority-1-normal