Closed as not planned
Description
- Are you reporting a bug, or opening a feature request? bug
- Please insert below the code you are checking with mypy
foo: bytes = bytearray()
assert isinstance(foo, bytes)
- What is the actual behavior/output?
No mypy error (and the expectedAssertionError
at runtime) - What is the behavior/output you expect?
Mypy error about assigning wrong type (and the expectedAssertionError
at runtime) - What are the versions of mypy and Python you are using?
mypy 0.761 on CPython 3.7.4 - What are the mypy flags you are using? (For example --strict-optional)
--strict
Typeshed appears to be fine, with bytes
and bytearray
both inheriting from ByteString
, but no inheritance of bytearray
from bytes
.
class bytes(ByteString):
...
class bytearray(MutableSequence[int], ByteString):
...