Title: @property hides multiple type errors · Issue #11892 · python/mypy · GitHub
Open Graph Title: @property hides multiple type errors · Issue #11892 · python/mypy
X Title: @property hides multiple type errors · Issue #11892 · python/mypy
Description: Bug Report This code defines self._body as Optional[bytes] and does not produce any type errors: https://github.com/aio-libs/aiohttp/blob/f1eb09b3756f4ed378a25f8a634f734952d2da35/aiohttp/web_response.py#L589 If I instead define the type ...
Open Graph Description: Bug Report This code defines self._body as Optional[bytes] and does not produce any type errors: https://github.com/aio-libs/aiohttp/blob/f1eb09b3756f4ed378a25f8a634f734952d2da35/aiohttp/web_respon...
X Description: Bug Report This code defines self._body as Optional[bytes] and does not produce any type errors: https://github.com/aio-libs/aiohttp/blob/f1eb09b3756f4ed378a25f8a634f734952d2da35/aiohttp/web_respon...
Opengraph URL: https://github.com/python/mypy/issues/11892
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"@property hides multiple type errors","articleBody":"**Bug Report**\r\n\r\nThis code defines `self._body` as `Optional[bytes]` and does not produce any type errors: https://github.com/aio-libs/aiohttp/blob/f1eb09b3756f4ed378a25f8a634f734952d2da35/aiohttp/web_response.py#L589\r\nIf I instead define the type on the class, like:\r\n```\r\nclass Response(StreamResponse):\r\n _body: Optional[bytes]\r\n```\r\n\r\nThen I get a type error: `Incompatible types in assignment (expression has type \"Optional[bytes]\", base class \"StreamResponse\" defined the type as \"None\") [assignment]`\r\n\r\n**To Reproduce**\r\n\r\nSee next comment.\r\n\r\n**Your Environment**\r\n\r\n- Mypy version used: 0.930 (but, those type errors must have been there for months already)\r\n- Mypy configuration options from `mypy.ini`: https://github.com/aio-libs/aiohttp/blob/master/.mypy.ini","author":{"url":"https://github.com/Dreamsorcerer","@type":"Person","name":"Dreamsorcerer"},"datePublished":"2022-01-03T13:50:00Z","url":"https://github.com/python/mypy/issues/11892"}
| 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:4e7b9c2b-3e3c-5fde-b9e4-7b53750c5cd5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E02E:22E079:1533926:1BC5987:6B000CDD |
| html-safe-nonce | 9012fc01a5e5efd144642e374e58a224f84d2ec38ac203a474599b4b485f398a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDJFOjIyRTA3OToxNTMzOTI2OjFCQzU5ODc6NkIwMDBDREQiLCJ2aXNpdG9yX2lkIjoiNDc4MDIzNzU0MDY5MzExODE3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 56dab2bf3158a3b5bc394eee4be0ceba15889367a1da45331e942e6d12b1c33d |
| hovercard-subject-tag | issue:1092528213 |
| 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/11892/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0d61166bb5cddb1408dd0f259c4934e659cc68a29b46f5434de5e00fa9362e09/python/mypy/issues/11892 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0d61166bb5cddb1408dd0f259c4934e659cc68a29b46f5434de5e00fa9362e09/python/mypy/issues/11892 |
| og:image:alt | Bug Report This code defines self._body as Optional[bytes] and does not produce any type errors: https://github.com/aio-libs/aiohttp/blob/f1eb09b3756f4ed378a25f8a634f734952d2da35/aiohttp/web_respon... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Dreamsorcerer |
| hostname | github.com |
| expected-hostname | github.com |
| None | cf7ee0062053ad9eb05b6e5de57bd96c2055708bcbada4144946b5ec129cf1d7 |
| 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 | 9cab7de176a56362d2aabcbb4d1e07e846eba8a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width