Title: Two crashes on recursive named tuples · Issue #3340 · python/mypy · GitHub
Open Graph Title: Two crashes on recursive named tuples · Issue #3340 · python/mypy
X Title: Two crashes on recursive named tuples · Issue #3340 · python/mypy
Description: While working on #3322 I have found two more crashes: N = NamedTuple('N', [('x', N)]) n: N crashes with RecursionError and class N(NamedTuple): x: N class M(NamedTuple): x: M n: N m: M lst = [n, m] crashes with AssertionError in join_ins...
Open Graph Description: While working on #3322 I have found two more crashes: N = NamedTuple('N', [('x', N)]) n: N crashes with RecursionError and class N(NamedTuple): x: N class M(NamedTuple): x: M n: N m: M lst = [n, m]...
X Description: While working on #3322 I have found two more crashes: N = NamedTuple('N', [('x', N)]) n: N crashes with RecursionError and class N(NamedTuple): x: N class M(NamedTuple): x: M n: N m...
Opengraph URL: https://github.com/python/mypy/issues/3340
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Two crashes on recursive named tuples","articleBody":"While working on #3322 I have found two more crashes:\r\n```python\r\nN = NamedTuple('N', [('x', N)])\r\nn: N\r\n```\r\ncrashes with ``RecursionError`` and\r\n```python\r\nclass N(NamedTuple):\r\n x: N\r\nclass M(NamedTuple):\r\n x: M\r\n\r\nn: N\r\nm: M\r\nlst = [n, m]\r\n```\r\ncrashes with ``AssertionError`` in ``join_instances_via_supertype``. I didn't try ``TypedDict`` but most probably it will have similar problems.\r\n\r\nThere is actually a fundamental question here: what _should_ be the ``join(N, M)``? @JukkaL do you have any ideas? One possible option would be to detect recursive joins and just return ``object`` for them (maybe also ``UninhabitedType`` for recursive meets).","author":{"url":"https://github.com/ilevkivskyi","@type":"Person","name":"ilevkivskyi"},"datePublished":"2017-05-08T12:33:51Z","url":"https://github.com/python/mypy/issues/3340"}
| 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:934ae5ab-fd13-4c7d-9afa-dc94cd563922 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A568:59847:BA03D4:F9462C:6B004E8A |
| html-safe-nonce | b2c44a04bd43a5c4d684b97c9578c6de16d9b446adbdd2decc8badb359e8e31e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTY4OjU5ODQ3OkJBMDNENDpGOTQ2MkM6NkIwMDRFOEEiLCJ2aXNpdG9yX2lkIjoiNjExMjc4NTE3NzU5Nzk4ODQ5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 311a050369169f80cade13340e25f0d53fc5cbeac58024ec4f64400a85a67f2a |
| hovercard-subject-tag | issue:227031486 |
| 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/3340/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7f2cb37081fb978ea40db7b8a303019f2e16a731b43e649fb089309696e0d2fa/python/mypy/issues/3340 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7f2cb37081fb978ea40db7b8a303019f2e16a731b43e649fb089309696e0d2fa/python/mypy/issues/3340 |
| og:image:alt | While working on #3322 I have found two more crashes: N = NamedTuple('N', [('x', N)]) n: N crashes with RecursionError and class N(NamedTuple): x: N class M(NamedTuple): x: M n: N m: M lst = [n, m]... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ilevkivskyi |
| hostname | github.com |
| expected-hostname | github.com |
| None | f9517bf360d46638a1e5e7daee7158842fe5ef43c9000afa0e127564a7c2f39b |
| 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 | b27c5dde30676028abd5c5fc53ce5c9b625f8281 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width