Title: AssertionError: assert isinstance(reinferred_rvalue_type, TupleType) in check_multi_assignment_from_tuple · Issue #3859 · python/mypy · GitHub
Open Graph Title: AssertionError: assert isinstance(reinferred_rvalue_type, TupleType) in check_multi_assignment_from_tuple · Issue #3859 · python/mypy
X Title: AssertionError: assert isinstance(reinferred_rvalue_type, TupleType) in check_multi_assignment_from_tuple · Issue #3859 · python/mypy
Description: With the testfile: test.py TEST = {'key': ('a', 'b')} def test(): # type: () -> None a, b = TEST.get('foo', ('x', 'y')) And mypy 0.521 installed via Homebrew on OSX. With the command: mypy --py2 --show-traceback test.py I get the followi...
Open Graph Description: With the testfile: test.py TEST = {'key': ('a', 'b')} def test(): # type: () -> None a, b = TEST.get('foo', ('x', 'y')) And mypy 0.521 installed via Homebrew on OSX. With the command: mypy --py2 --...
X Description: With the testfile: test.py TEST = {'key': ('a', 'b')} def test(): # type: () -> None a, b = TEST.get('foo', ('x', 'y')) And mypy 0.521 installed v...
Opengraph URL: https://github.com/python/mypy/issues/3859
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AssertionError: assert isinstance(reinferred_rvalue_type, TupleType) in check_multi_assignment_from_tuple","articleBody":"With the testfile: test.py\r\n```\r\nTEST = {'key': ('a', 'b')}\r\ndef test():\r\n # type: () -> None\r\n a, b = TEST.get('foo', ('x', 'y'))\r\n```\r\n\r\nAnd mypy 0.521 installed via Homebrew on OSX.\r\n\r\nWith the command: `mypy --py2 --show-traceback test.py`\r\n\r\nI get the following stack trace:\r\n```\r\nmypy --py2 --show-traceback test.py\r\n\r\ntest.py:6: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty\r\nTraceback (most recent call last):\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/bin/mypy\", line 11, in \u003cmodule>\r\n load_entry_point('mypy===0.521-858f7512cf3b4e39c0f4e8de5a13eee0e1e138fb-dirty', 'console_scripts', 'mypy')()\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/__main__.py\", line 7, in console_entry\r\n main(None)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/main.py\", line 50, in main\r\n res = type_check_only(sources, bin_dir, options)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/main.py\", line 97, in type_check_only\r\n options=options)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/build.py\", line 196, in build\r\n graph = dispatch(sources, manager)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/build.py\", line 1801, in dispatch\r\n process_graph(graph, manager)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/build.py\", line 2044, in process_graph\r\n process_stale_scc(graph, scc, manager)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/build.py\", line 2147, in process_stale_scc\r\n graph[id].type_check_first_pass()\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/build.py\", line 1716, in type_check_first_pass\r\n self.type_checker.check_first_pass()\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/checker.py\", line 185, in check_first_pass\r\n self.accept(d)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/checker.py\", line 273, in accept\r\n stmt.accept(self)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/nodes.py\", line 565, in accept\r\n return visitor.visit_func_def(self)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/checker.py\", line 519, in visit_func_def\r\n self.check_func_item(defn, name=defn.name())\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/checker.py\", line 578, in check_func_item\r\n self.check_func_def(defn, typ, name)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/checker.py\", line 738, in check_func_def\r\n self.accept(item.body)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/checker.py\", line 273, in accept\r\n stmt.accept(self)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/nodes.py\", line 815, in accept\r\n return visitor.visit_block(self)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/checker.py\", line 1202, in visit_block\r\n self.accept(s)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/checker.py\", line 273, in accept\r\n stmt.accept(self)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/nodes.py\", line 859, in accept\r\n return visitor.visit_assignment_stmt(self)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/checker.py\", line 1209, in visit_assignment_stmt\r\n self.check_assignment(s.lvalues[-1], s.rvalue, s.type is None, s.new_syntax)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/checker.py\", line 1236, in check_assignment\r\n infer_lvalue_type)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/checker.py\", line 1483, in check_assignment_to_multiple_lvalues\r\n self.check_multi_assignment(lvalues, rvalue, context, infer_lvalue_type)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/checker.py\", line 1522, in check_multi_assignment\r\n context, undefined_rvalue, infer_lvalue_type)\r\n File \"/usr/local/Cellar/mypy/0.521/libexec/lib/python3.6/site-packages/mypy/checker.py\", line 1550, in check_multi_assignment_from_tuple\r\n assert isinstance(reinferred_rvalue_type, TupleType)\r\nAssertionError:\r\ntest.py:6: note: use --pdb to drop into pdb\r\n```","author":{"url":"https://github.com/emorikawa","@type":"Person","name":"emorikawa"},"datePublished":"2017-08-22T17:50:48Z","url":"https://github.com/python/mypy/issues/3859"}
| 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:9c9a0c89-a5c3-88ad-3927-bbac9795a120 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D48:3EE843:208FD59:2C5E6A3:6B002585 |
| html-safe-nonce | bca553fc49018ee3427c92a88fc105ca23b00b47e5fba31e4e5b498cf88a3bf5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDQ4OjNFRTg0MzoyMDhGRDU5OjJDNUU2QTM6NkIwMDI1ODUiLCJ2aXNpdG9yX2lkIjoiOTA5NTM1Nzc4OTYxMzU5ODA4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bf56f80e143425f05d84c17d608de2ecb049bb666969ead2b5868661de81f503 |
| hovercard-subject-tag | issue:252038042 |
| 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/3859/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d7dc702a3bd8057156a55e6e5601a838364b00d9973586d209abfadb06943f43/python/mypy/issues/3859 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d7dc702a3bd8057156a55e6e5601a838364b00d9973586d209abfadb06943f43/python/mypy/issues/3859 |
| og:image:alt | With the testfile: test.py TEST = {'key': ('a', 'b')} def test(): # type: () -> None a, b = TEST.get('foo', ('x', 'y')) And mypy 0.521 installed via Homebrew on OSX. With the command: mypy --py2 --... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | emorikawa |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width