Title: Cannot resolve recursive/cyclic definitions (v0.991, Python 3.8/3.9) · Issue #14219 · python/mypy · GitHub
Open Graph Title: Cannot resolve recursive/cyclic definitions (v0.991, Python 3.8/3.9) · Issue #14219 · python/mypy
X Title: Cannot resolve recursive/cyclic definitions (v0.991, Python 3.8/3.9) · Issue #14219 · python/mypy
Description: Bug Report Mypy fails to check recursive/cyclic type aliases, even with #731 being part of v0.991. However, this happens on Python 3.8 and 3.9 only (and possibly below), but not on 3.10 or 3.11. Example: RecursiveTypeAlias: TypeAlias = U...
Open Graph Description: Bug Report Mypy fails to check recursive/cyclic type aliases, even with #731 being part of v0.991. However, this happens on Python 3.8 and 3.9 only (and possibly below), but not on 3.10 or 3.11. Ex...
X Description: Bug Report Mypy fails to check recursive/cyclic type aliases, even with #731 being part of v0.991. However, this happens on Python 3.8 and 3.9 only (and possibly below), but not on 3.10 or 3.11. Ex...
Opengraph URL: https://github.com/python/mypy/issues/14219
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cannot resolve recursive/cyclic definitions (v0.991, Python 3.8/3.9)","articleBody":"**Bug Report**\r\n\r\nMypy fails to check recursive/cyclic type aliases, even with https://github.com/python/mypy/issues/731 being part of v0.991. However, this happens on Python 3.8 and 3.9 only (and possibly below), but not on 3.10 or 3.11.\r\nExample:\r\n```python\r\nRecursiveTypeAlias: TypeAlias = Union[bool, int, float, str, Sequence['RecursiveTypeAlias']]\r\n```\r\nfor which mypy raises `error: Cannot resolve name \"RecursiveTypeAlias\" (possible cyclic definition) [misc]`.\r\n\r\n**To Reproduce**\r\n- Create an environment with:\r\n - Mypy v0.991\r\n - Python 3.8 or 3.9\r\n - typing_extensions 4.4.0\r\n- Create a Python file with the offending type alias. See https://github.com/bartfeenstra/mypy-type-alias/blob/main/mypy-type-alias/main.py for additional imports for cross-Python-version compatibility.\r\n- Run mypy without any additional options or arguments\r\n\r\nAlternatively, clone https://github.com/bartfeenstra/mypy-type-alias and run `tox`.\r\n\r\n**Expected Behavior**\r\nMypy not raising any errors for recursive/cyclig type aliases and correctly parsing them as it does on Python 3.10 and 3.11.\r\n\r\n**Actual Behavior**\r\nMypy fails on recursive/cyclic type aliases with the error `error: Cannot resolve name \"RecursiveTypeAlias\" (possible cyclic definition) [misc]`.\r\n","author":{"url":"https://github.com/bartfeenstra","@type":"Person","name":"bartfeenstra"},"datePublished":"2022-11-29T11:32:31Z","url":"https://github.com/python/mypy/issues/14219"}
| 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:3c86c352-b1eb-cc8a-684b-cd33860122b1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EC98:1A3D7F:325A938:42A7B1F:6B002F57 |
| html-safe-nonce | 906be8820f860af1bc59b4a9323efb95fdd6377f20f1c80078af6185a085cc0e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzk4OjFBM0Q3RjozMjVBOTM4OjQyQTdCMUY6NkIwMDJGNTciLCJ2aXNpdG9yX2lkIjoiMTQ2MzQ3MDI2MzQ5NTU2OTIzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 902e27e28dfc0545537694b0a3032cd9398be8b3888910bd2a8744c4832d6f7b |
| hovercard-subject-tag | issue:1467904764 |
| 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/14219/issue_layout |
| twitter:image | https://opengraph.githubassets.com/74722953c764d14f844fafb562bca14ce56731aad0aebfd90e8bdb11896b614c/python/mypy/issues/14219 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/74722953c764d14f844fafb562bca14ce56731aad0aebfd90e8bdb11896b614c/python/mypy/issues/14219 |
| og:image:alt | Bug Report Mypy fails to check recursive/cyclic type aliases, even with #731 being part of v0.991. However, this happens on Python 3.8 and 3.9 only (and possibly below), but not on 3.10 or 3.11. Ex... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bartfeenstra |
| 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