Title: `bytearray` treated as a subclass of `bytes` · Issue #8505 · python/mypy · GitHub
Open Graph Title: `bytearray` treated as a subclass of `bytes` · Issue #8505 · python/mypy
X Title: `bytearray` treated as a subclass of `bytes` · Issue #8505 · python/mypy
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 expected...
Open Graph 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...
X 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...
Opengraph URL: https://github.com/python/mypy/issues/8505
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`bytearray` treated as a subclass of `bytes`","articleBody":"* Are you reporting a bug, or opening a feature request? bug\r\n* Please insert below the code you are checking with mypy\r\n```python\r\nfoo: bytes = bytearray()\r\nassert isinstance(foo, bytes)\r\n```\r\n* What is the actual behavior/output?\r\nNo mypy error (and the expected `AssertionError` at runtime)\r\n* What is the behavior/output you expect?\r\nMypy error about assigning wrong type (and the expected `AssertionError` at runtime)\r\n* What are the versions of mypy and Python you are using?\r\nmypy 0.761 on CPython 3.7.4\r\n* What are the mypy flags you are using? (For example --strict-optional)\r\n`--strict`\r\n\r\nTypeshed appears to be fine, with `bytes` and `bytearray` both inheriting from `ByteString`, but no inheritance of `bytearray` from `bytes`.\r\n\r\n```python\r\nclass bytes(ByteString):\r\n ...\r\n\r\nclass bytearray(MutableSequence[int], ByteString):\r\n ...\r\n```","author":{"url":"https://github.com/llchan","@type":"Person","name":"llchan"},"datePublished":"2020-03-07T01:21:45Z","url":"https://github.com/python/mypy/issues/8505"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:64d8d1b5-991c-2e31-350d-59e85a813a8f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BAFC:44D65:4DA4E1:682EA3:6B00303F |
| html-safe-nonce | e1ba8a66c6b5b1585da92e281aca453f891c2eed289101d5e0740f5bcd9f7ca8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUZDOjQ0RDY1OjREQTRFMTo2ODJFQTM6NkIwMDMwM0YiLCJ2aXNpdG9yX2lkIjoiNDY5NjI0MTMxNjI1NjgyMTMxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d723a3748c9dcb9e74cbce8f7d4e1dc5dd7b77f8f78652eda70e95c269a9bb5d |
| hovercard-subject-tag | issue:577251820 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/8505/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8f30a945d76cf9b2e90bab33cd1598e5817a1ad0cece5f57f48b7fed2e5559ee/python/mypy/issues/8505 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8f30a945d76cf9b2e90bab33cd1598e5817a1ad0cece5f57f48b7fed2e5559ee/python/mypy/issues/8505 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | llchan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width