Title: False positive on mutual recursion involving a type alias · Issue #3418 · python/mypy · GitHub
Open Graph Title: False positive on mutual recursion involving a type alias · Issue #3418 · python/mypy
X Title: False positive on mutual recursion involving a type alias · Issue #3418 · python/mypy
Description: This produces an error but (I think) shouldn't: from typing import List class A(object): b: 'B' # E: Invalid type "recurse.B" B = List[A] It works fine if I make B a class, even a class inheriting from A. I encountered this in https://gi...
Open Graph Description: This produces an error but (I think) shouldn't: from typing import List class A(object): b: 'B' # E: Invalid type "recurse.B" B = List[A] It works fine if I make B a class, even a class inheriting ...
X Description: This produces an error but (I think) shouldn't: from typing import List class A(object): b: 'B' # E: Invalid type "recurse.B" B = List[A] It works fine if I make B a class, ev...
Opengraph URL: https://github.com/python/mypy/issues/3418
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"False positive on mutual recursion involving a type alias","articleBody":"This produces an error but (I think) shouldn't:\r\n```\r\nfrom typing import List\r\n\r\nclass A(object):\r\n b: 'B' # E: Invalid type \"recurse.B\"\r\n\r\nB = List[A]\r\n```\r\nIt works fine if I make `B` a class, even a class inheriting from `A`. I encountered this in https://github.com/JelleZijlstra/typeshed_client/blob/master/typeshed_client/parser.py#L30 (A is NameInfo and B is NameDict).","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2017-05-23T06:56:31Z","url":"https://github.com/python/mypy/issues/3418"}
| 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:4f6dba38-8364-bbd5-0981-0b88a1f5857f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F12:24D752:F103C1:143AF42:6B005A20 |
| html-safe-nonce | f2e632b3bbc7e3f0436707084ab9b2a18306c53e0f9685a46390ef3085b23956 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjEyOjI0RDc1MjpGMTAzQzE6MTQzQUY0Mjo2QjAwNUEyMCIsInZpc2l0b3JfaWQiOiIyNjU3OTc1MTMwMzYxMTkwOTQ0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 996d29fd2f8de2f114a86f69b9ebfdc928526ad4647a6be2ba98a472d13ee7f0 |
| hovercard-subject-tag | issue:230604604 |
| 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/3418/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e7a5d0aa05a64df7ed04ff083ba6745cf1e72828f06404f256921f8eb39b50dc/python/mypy/issues/3418 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e7a5d0aa05a64df7ed04ff083ba6745cf1e72828f06404f256921f8eb39b50dc/python/mypy/issues/3418 |
| og:image:alt | This produces an error but (I think) shouldn't: from typing import List class A(object): b: 'B' # E: Invalid type "recurse.B" B = List[A] It works fine if I make B a class, even a class inheriting ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JelleZijlstra |
| hostname | github.com |
| expected-hostname | github.com |
| None | 29be975efff6507a5d135de9c7d634cf7ff8f0c55222a64386ab3202209aaf73 |
| 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 | eacd927ba6112e3b01ba99c762bd699a4a4f5df7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width