Open
Description
PEP 688 (https://peps.python.org/pep-0688/#no-special-meaning-for-bytes) specifies that type checkers should stop treating bytes
as implicitly equivalent to bytes | bytearray | memoryview
. Mypy should implement this change.
We already have hidden flags to disable the promotions (added in #13952) and I have a draft PR that shows the impact of disabling them (#12661). I would suggest the following plan:
- Promote
--disable-bytearray-promotion
and--disable-memoryview-promotion
to public, documented flags now - The next time we increment mypy's major version number, flip the default