Title: Confusing error: incompatible type "Type[bytes]"; expected "Type[bytes]" · Issue #9756 · python/mypy · GitHub
Open Graph Title: Confusing error: incompatible type "Type[bytes]"; expected "Type[bytes]" · Issue #9756 · python/mypy
X Title: Confusing error: incompatible type "Type[bytes]"; expected "Type[bytes]" · Issue #9756 · python/mypy
Description: Bug Report Error message seems to indicate it requires the type it is getting. I could be reading the error message wrong, but this one confuses me. To Reproduce put the code in a file e.g. scratchpad.py from typing import Type def f(cla...
Open Graph Description: Bug Report Error message seems to indicate it requires the type it is getting. I could be reading the error message wrong, but this one confuses me. To Reproduce put the code in a file e.g. scratch...
X Description: Bug Report Error message seems to indicate it requires the type it is getting. I could be reading the error message wrong, but this one confuses me. To Reproduce put the code in a file e.g. scratch...
Opengraph URL: https://github.com/python/mypy/issues/9756
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Confusing error: incompatible type \"Type[bytes]\"; expected \"Type[bytes]\"","articleBody":"**Bug Report**\r\n\r\nError message seems to indicate it requires the type it is getting. I could be reading the error message wrong, but this one confuses me.\r\n\r\n**To Reproduce**\r\n1. put the code in a file e.g. scratchpad.py\r\n ```python\r\n from typing import Type\r\n \r\n def f(class_type: Type[object]):\r\n if class_type in [bytes, bytearray]:\r\n return True\r\n ```\r\n2. run `mypy scratchpad.py`\r\n\r\n**Expected Behavior**\r\nno errors\r\n\r\n**Actual Behavior**\r\n> scratchpad.py:4: error: List item 0 has incompatible type \"Type[bytes]\"; expected \"Type[bytes]\"\r\n\r\n**Your Environment**\r\n\r\n\u003c!-- Include as many relevant details about the environment you experienced the bug in -->\r\n\r\n- Mypy version used: 0.790\r\n- Mypy command-line flags: n/a\r\n- Mypy configuration options from `mypy.ini` (and other config files): n/a\r\n- Python version used: 3.8.3\r\n- Operating system and version: OSX 10.15.7","author":{"url":"https://github.com/ixje","@type":"Person","name":"ixje"},"datePublished":"2020-11-25T09:17:22Z","url":"https://github.com/python/mypy/issues/9756"}
| 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:633cae40-a112-ebbc-387f-9a2ef845c896 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B8DE:1A3D7F:26CF8A7:32A19F1:6AFFF92E |
| html-safe-nonce | 3af00f8b9b5135eb0aaf6b11bac80e661a578a3ebf940cd71b6124f7b67ea525 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOERFOjFBM0Q3RjoyNkNGOEE3OjMyQTE5RjE6NkFGRkY5MkUiLCJ2aXNpdG9yX2lkIjoiNTg5MzQyODE3OTc0NTM3MjQ2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 78c11321f04ec6cfc9757d3aea8dd232dda853cc61f9ae79343d4efc344bf59d |
| hovercard-subject-tag | issue:750638998 |
| 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/9756/issue_layout |
| twitter:image | https://opengraph.githubassets.com/23720b05bc6e721fc34e1f333e20bb002a281415881f8dc6e3dc322bb9ffd1fe/python/mypy/issues/9756 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/23720b05bc6e721fc34e1f333e20bb002a281415881f8dc6e3dc322bb9ffd1fe/python/mypy/issues/9756 |
| og:image:alt | Bug Report Error message seems to indicate it requires the type it is getting. I could be reading the error message wrong, but this one confuses me. To Reproduce put the code in a file e.g. scratch... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ixje |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| 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 | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width