Title: Error message for typing_extensions.Self is confusing · Issue #14089 · python/mypy · GitHub
Open Graph Title: Error message for typing_extensions.Self is confusing · Issue #14089 · python/mypy
X Title: Error message for typing_extensions.Self is confusing · Issue #14089 · python/mypy
Description: Bug Report It looks like mypy doesn't support typing_extensions.Self. I know that Rome wasn't built in a day and the work in #11871 is on the way. However, while it's still in progress, I think it would be great to have a user-friendly e...
Open Graph Description: Bug Report It looks like mypy doesn't support typing_extensions.Self. I know that Rome wasn't built in a day and the work in #11871 is on the way. However, while it's still in progress, I think it ...
X Description: Bug Report It looks like mypy doesn't support typing_extensions.Self. I know that Rome wasn't built in a day and the work in #11871 is on the way. However, while it's still in progress,...
Opengraph URL: https://github.com/python/mypy/issues/14089
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error message for typing_extensions.Self is confusing","articleBody":"\u003c!--\r\nIf you're not sure whether what you're experiencing is a mypy bug, please see the \"Question and Help\" form instead.\r\nPlease consider:\r\n\r\n- checking our common issues page: https://mypy.readthedocs.io/en/stable/common_issues.html\r\n- searching our issue tracker: https://github.com/python/mypy/issues to see if it's already been reported\r\n- asking on gitter chat: https://gitter.im/python/typing\r\n-->\r\n\r\n**Bug Report**\r\n\r\nIt looks like mypy doesn't support `typing_extensions.Self`. I know that Rome wasn't built in a day and the work in #11871 is on the way. However, while it's still in progress, I think it would be great to have a user-friendly error message that better explains the nature of the error.\r\n\r\n**To Reproduce**\r\n\r\n```python\r\nfrom typing_extensions import Self\r\n\r\nclass A:\r\n def f(self) -> Self:\r\n return self\r\n```\r\n\r\n**Expected Behavior**\r\n\r\nI'd expect a user-friendly error message explaining the nature of the issue, something like this:\r\n\r\n```\r\ntmp.py:5: note: \"typing_extensions.Self\" is not supported yet, see #11871 [misc]\r\n```\r\n\r\n**Actual Behavior**\r\n\r\n```\r\ntmp.py:5: error: Variable \"typing_extensions.Self\" is not valid as a type [valid-type]\r\n```\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.990\r\n- Mypy command-line flags: `mypy tmp.py`\r\n- Mypy configuration options from `mypy.ini` (and other config files): `-`\r\n- Python version used: `3.10.6`\r\n\r\n\u003c!-- You can freely edit this text, please remove all the lines you believe are unnecessary. -->\r\n\r\n\r\n\nhttps://github.com/python/mypy/issues/14089#tasklist-block-405fc2fb-be51-4886-835a-ce2c9d65608a\n","author":{"url":"https://github.com/orsinium","@type":"Person","name":"orsinium"},"datePublished":"2022-11-14T09:01:11Z","url":"https://github.com/python/mypy/issues/14089"}
| 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:cb942219-bf7b-e050-314e-cfa70d3095b8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B130:C5FC2:123A2F1:17D9B01:6B000BF0 |
| html-safe-nonce | bdd6a598132d831b4ebe836950d9845cbed667ac53633523fa1ebde6d754af6e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTMwOkM1RkMyOjEyM0EyRjE6MTdEOUIwMTo2QjAwMEJGMCIsInZpc2l0b3JfaWQiOiIzMTY4MzY1MDczNjA1MzMxOTUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6df8ae03ef0a63911ded4a0eba9453c3b9ed298803f89575a369de3151603598 |
| hovercard-subject-tag | issue:1447654040 |
| 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/14089/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6179dd8e11b87884bbddd757347082eed8807f679b5be3edcdfc0dd13d6c652f/python/mypy/issues/14089 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6179dd8e11b87884bbddd757347082eed8807f679b5be3edcdfc0dd13d6c652f/python/mypy/issues/14089 |
| og:image:alt | Bug Report It looks like mypy doesn't support typing_extensions.Self. I know that Rome wasn't built in a day and the work in #11871 is on the way. However, while it's still in progress, I think it ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | orsinium |
| 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