Title: Another AssertionError with TypedDict and --cache-fine-grained in v1.11.0 · Issue #17587 · python/mypy · GitHub
Open Graph Title: Another AssertionError with TypedDict and --cache-fine-grained in v1.11.0 · Issue #17587 · python/mypy
X Title: Another AssertionError with TypedDict and --cache-fine-grained in v1.11.0 · Issue #17587 · python/mypy
Description: dmypy crashes on import stripe, and I reduced the failure to the minimal test case below with no external dependencies. This is similar to #17515, but it remains a problem on current master (e67decb) even after #17515 was marked fixed. T...
Open Graph Description: dmypy crashes on import stripe, and I reduced the failure to the minimal test case below with no external dependencies. This is similar to #17515, but it remains a problem on current master (e67dec...
X Description: dmypy crashes on import stripe, and I reduced the failure to the minimal test case below with no external dependencies. This is similar to #17515, but it remains a problem on current master (e67dec...
Opengraph URL: https://github.com/python/mypy/issues/17587
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Another AssertionError with TypedDict and --cache-fine-grained in v1.11.0","articleBody":"`dmypy` crashes on `import stripe`, and I reduced the failure to the minimal test case below with no external dependencies. This is similar to\r\n\r\n- #17515,\r\n\r\nbut it remains a problem on current `master` (e67decb91ea5aacbb1e126463b02d78ded680a90) even after #17515 was marked fixed. This is a regression in v1.11.0, and `git bisect` shows it was introduced by 1072c78ad375b7f0511549287f54432050396717 (#17148, cc @JelleZijlstra).\r\n\r\n**`test.py`**\r\n\r\n```python\r\nfrom typing import TypedDict\r\n\r\nclass A(TypedDict):\r\n b: \"B\"\r\n\r\nclass B(TypedDict):\r\n c: \"C\"\r\n\r\nclass C(TypedDict):\r\n d: \"D\"\r\n\r\nclass D:\r\n pass\r\n```\r\n\r\n```pytb\r\n$ mypy --show-traceback --cache-fine-grained test.py\r\ntest.py: error: INTERNAL ERROR -- Please try using mypy master on GitHub:\r\nhttps://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build\r\nPlease report a bug at https://github.com/python/mypy/issues\r\nversion: 1.12.0+dev.e67decb91ea5aacbb1e126463b02d78ded680a90\r\nTraceback (most recent call last):\r\n File \"/tmp/venv/bin/mypy\", line 8, in \u003cmodule>\r\n sys.exit(console_entry())\r\n File \"/home/anders/python/mypy/mypy/__main__.py\", line 15, in console_entry\r\n main()\r\n File \"/home/anders/python/mypy/mypy/main.py\", line 103, in main\r\n res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)\r\n File \"/home/anders/python/mypy/mypy/main.py\", line 187, in run_build\r\n res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\r\n File \"/home/anders/python/mypy/mypy/build.py\", line 193, in build\r\n result = _build(\r\n File \"/home/anders/python/mypy/mypy/build.py\", line 268, in _build\r\n graph = dispatch(sources, manager, stdout)\r\n File \"/home/anders/python/mypy/mypy/build.py\", line 2950, in dispatch\r\n process_graph(graph, manager)\r\n File \"/home/anders/python/mypy/mypy/build.py\", line 3348, in process_graph\r\n process_stale_scc(graph, scc, manager)\r\n File \"/home/anders/python/mypy/mypy/build.py\", line 3453, in process_stale_scc\r\n graph[id].finish_passes()\r\n File \"/home/anders/python/mypy/mypy/build.py\", line 2372, in finish_passes\r\n with self.wrap_context():\r\n File \"/nix/store/z7xxy35k7620hs6fn6la5fg2lgklv72l-python3-3.12.4/lib/python3.12/contextlib.py\", line 158, in __exit__\r\n self.gen.throw(value)\r\n File \"/home/anders/python/mypy/mypy/build.py\", line 2069, in wrap_context\r\n yield\r\n File \"/home/anders/python/mypy/mypy/build.py\", line 2409, in finish_passes\r\n self.update_fine_grained_deps(self.manager.fg_deps)\r\n File \"/home/anders/python/mypy/mypy/build.py\", line 2467, in update_fine_grained_deps\r\n merge_dependencies(self.compute_fine_grained_deps(), deps)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/anders/python/mypy/mypy/build.py\", line 2455, in compute_fine_grained_deps\r\n return get_dependencies(\r\n ^^^^^^^^^^^^^^^^^\r\n File \"/home/anders/python/mypy/mypy/server/deps.py\", line 187, in get_dependencies\r\n target.accept(visitor)\r\n File \"/home/anders/python/mypy/mypy/nodes.py\", line 372, in accept\r\n return visitor.visit_mypy_file(self)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/anders/python/mypy/mypy/server/deps.py\", line 250, in visit_mypy_file\r\n super().visit_mypy_file(o)\r\n File \"/home/anders/python/mypy/mypy/traverser.py\", line 116, in visit_mypy_file\r\n d.accept(self)\r\n File \"/home/anders/python/mypy/mypy/nodes.py\", line 1183, in accept\r\n return visitor.visit_class_def(self)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/anders/python/mypy/mypy/server/deps.py\", line 310, in visit_class_def\r\n super().visit_class_def(o)\r\n File \"/home/anders/python/mypy/mypy/traverser.py\", line 152, in visit_class_def\r\n o.defs.accept(self)\r\n File \"/home/anders/python/mypy/mypy/nodes.py\", line 1264, in accept\r\n return visitor.visit_block(self)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/anders/python/mypy/mypy/server/deps.py\", line 429, in visit_block\r\n super().visit_block(o)\r\n File \"/home/anders/python/mypy/mypy/traverser.py\", line 120, in visit_block\r\n s.accept(self)\r\n File \"/home/anders/python/mypy/mypy/nodes.py\", line 1351, in accept\r\n return visitor.visit_assignment_stmt(self)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/anders/python/mypy/mypy/server/deps.py\", line 490, in visit_assignment_stmt\r\n self.add_type_dependencies(o.type)\r\n File \"/home/anders/python/mypy/mypy/server/deps.py\", line 887, in add_type_dependencies\r\n for trigger in self.get_type_triggers(typ):\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/anders/python/mypy/mypy/server/deps.py\", line 940, in get_type_triggers\r\n return get_type_triggers(typ, self.use_logical_deps())\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/anders/python/mypy/mypy/server/deps.py\", line 947, in get_type_triggers\r\n return typ.accept(TypeTriggersVisitor(use_logical_deps, seen_aliases))\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/anders/python/mypy/mypy/types.py\", line 2708, in accept\r\n assert isinstance(visitor, SyntheticTypeVisitor)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\nAssertionError: \r\ntest.py: : note: use --pdb to drop into pdb\r\n```\r\n","author":{"url":"https://github.com/andersk","@type":"Person","name":"andersk"},"datePublished":"2024-07-26T01:54:06Z","url":"https://github.com/python/mypy/issues/17587"}
| 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:4e5e5cf0-7bc9-1622-a981-e31d3a10f55a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B656:91831:FD63B:161F8F:6B0063EA |
| html-safe-nonce | df887730418fca538a3edaf6c5af3622c81f5b1ee207ebeb00c2802ca9996e21 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjU2OjkxODMxOkZENjNCOjE2MUY4Rjo2QjAwNjNFQSIsInZpc2l0b3JfaWQiOiI3NjI1ODI5NTI4MDgxODE4NjAyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c19576ac9f3d4a513e88a5cbccbcd639a22131412e75db73e8a31f9109993489 |
| hovercard-subject-tag | issue:2431260323 |
| 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/17587/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8c952f8e738396750a230185b24a82d721216f719bd30472d4569570191ac5f9/python/mypy/issues/17587 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8c952f8e738396750a230185b24a82d721216f719bd30472d4569570191ac5f9/python/mypy/issues/17587 |
| og:image:alt | dmypy crashes on import stripe, and I reduced the failure to the minimal test case below with no external dependencies. This is similar to #17515, but it remains a problem on current master (e67dec... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andersk |
| hostname | github.com |
| expected-hostname | github.com |
| None | 25854482a1773a7c1ebb8be3d2bc1c6e61d82d78126be63b5044474a86d44d9e |
| 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 | e4f5c239e31f1f680e6bbc419ff92d774da616ec |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width