Title: [mypyc] support of `@final` types · Issue #9612 · python/mypy · GitHub
Open Graph Title: [mypyc] support of `@final` types · Issue #9612 · python/mypy
X Title: [mypyc] support of `@final` types · Issue #9612 · python/mypy
Description: Bug Report I am trying to compile a module with @final types. This does not seem possible at the moment with mypyc. Actual source: https://github.com/dry-python/returns/blob/master/returns/result.py#L312 To Reproduce from typing_extensio...
Open Graph Description: Bug Report I am trying to compile a module with @final types. This does not seem possible at the moment with mypyc. Actual source: https://github.com/dry-python/returns/blob/master/returns/result.p...
X Description: Bug Report I am trying to compile a module with @final types. This does not seem possible at the moment with mypyc. Actual source: https://github.com/dry-python/returns/blob/master/returns/result.p...
Opengraph URL: https://github.com/python/mypy/issues/9612
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[mypyc] support of `@final` types","articleBody":"**Bug Report**\r\n\r\n\u003c!--\r\nNote: If the problem you are reporting is about a specific library function, then the typeshed tracker is better suited\r\nfor this report: https://github.com/python/typeshed/issues\r\n-->\r\n\r\nI am trying to compile a module with `@final` types.\r\nThis does not seem possible at the moment with `mypyc`.\r\n\r\nActual source: https://github.com/dry-python/returns/blob/master/returns/result.py#L312\r\n\r\n**To Reproduce**\r\n\r\n```python\r\nfrom typing_extensions import final\r\n\r\n\r\nclass Base(object):\r\n \"\"\"Can be sub-classed.\"\"\"\r\n\r\n\r\n@final\r\nclass Child(Base):\r\n \"\"\"Final instance.\"\"\"\r\n```\r\n\r\nWhen `mypyc` is used on top of this code, this happens:\r\n\r\n```\r\n» mypyc ex.py\r\nex.py:9: error: Non-extension classes may not inherit from extension classes\r\n```\r\n\r\nAs I understand, `mypyc` treats `@final` as a regular decorator and then makes `Child` a non-exntesion class.\r\nAnd this does not seem correct to me. \r\n\r\n**Expected Behavior**\r\n\r\nI would expect this code to compile without any warnings.\r\nAnd `@final` should be treated the same way `mypy` does with regular `python` code.\r\n\r\n- Mypy version used: `0.790`\r\n","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2020-10-18T22:35:56Z","url":"https://github.com/python/mypy/issues/9612"}
| 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:aa58b8b0-50a1-f353-a2fb-4daf18ebb950 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D14:3A13A0:2583D2E:32F15B0:6B003830 |
| html-safe-nonce | 13fe2bc29b2479f9e4f1b3cd75f3177dec4e7b400d740875939ddd105a91c967 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDE0OjNBMTNBMDoyNTgzRDJFOjMyRjE1QjA6NkIwMDM4MzAiLCJ2aXNpdG9yX2lkIjoiMTQ2Mzk3MDQwODE0MjIyMzQwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 26a2eae693ff24edb14bffbe9d05c5bab24d271ca42607e66038a3fce1bc087e |
| hovercard-subject-tag | issue:724136517 |
| 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/9612/issue_layout |
| twitter:image | https://opengraph.githubassets.com/07f3e6a9e5cef190f0876f4a3e076cc8126066cd246a37bb747ba2ded91b3f38/python/mypy/issues/9612 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/07f3e6a9e5cef190f0876f4a3e076cc8126066cd246a37bb747ba2ded91b3f38/python/mypy/issues/9612 |
| og:image:alt | Bug Report I am trying to compile a module with @final types. This does not seem possible at the moment with mypyc. Actual source: https://github.com/dry-python/returns/blob/master/returns/result.p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sobolevn |
| 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