Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop bytes/bytearray and bytes/memoryview promotions (PEP 688) #15313

Open
JelleZijlstra opened this issue May 26, 2023 · 0 comments
Open

Drop bytes/bytearray and bytes/memoryview promotions (PEP 688) #15313

JelleZijlstra opened this issue May 26, 2023 · 0 comments
Labels

Comments

@JelleZijlstra
Copy link
Member

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant