Title: Crash on simple namedtuple · Issue #3781 · python/mypy · GitHub
Open Graph Title: Crash on simple namedtuple · Issue #3781 · python/mypy
X Title: Crash on simple namedtuple · Issue #3781 · python/mypy
Description: The following code caused an internal error on version 0.521. I did a cursory search of the current issue tracker and didn't find anything that matched the simplicity of this case. from collections import namedtuple HeData = namedtuple("...
Open Graph Description: The following code caused an internal error on version 0.521. I did a cursory search of the current issue tracker and didn't find anything that matched the simplicity of this case. from collections...
X Description: The following code caused an internal error on version 0.521. I did a cursory search of the current issue tracker and didn't find anything that matched the simplicity of this case. from collect...
Opengraph URL: https://github.com/python/mypy/issues/3781
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash on simple namedtuple","articleBody":"The following code caused an internal error on version 0.521. I did a cursory search of the current issue tracker and didn't find anything that matched the simplicity of this case.\r\n\r\n```\r\nfrom collections import namedtuple\r\n \r\nHeData = namedtuple(\"HeData\", \"run cell scale dt fid t1\")\r\n```\r\nthe traceback is:\r\n\r\n```\r\n/home/adam/.local/lib/mypy/typeshed/stdlib/3/typing.pyi:5: error: Module 'types' has no attribute 'CodeType'\r\n/home/adam/.local/lib/mypy/typeshed/stdlib/3/typing.pyi:5: error: Module 'types' has no attribute 'FrameType'\r\n/home/adam/.local/lib/mypy/typeshed/stdlib/3/typing.pyi:5: error: Module 'types' has no attribute 'TracebackType'\r\ntypes.py:3: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.521\r\nTraceback (most recent call last):\r\n File \"/home/adam/.local/bin/mypy\", line 11, in \u003cmodule>\r\n sys.exit(console_entry())\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/__main__.py\", line 7, in console_entry\r\n main(None)\r\n File \"/home/adam/.local/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 \"/home/adam/.local/lib/python3.6/site-packages/mypy/main.py\", line 97, in type_check_only\r\n options=options)\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/build.py\", line 196, in build\r\n graph = dispatch(sources, manager)\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/build.py\", line 1801, in dispatch\r\n process_graph(graph, manager)\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/build.py\", line 2044, in process_graph\r\n process_stale_scc(graph, scc, manager)\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/build.py\", line 2139, in process_stale_scc\r\n graph[id].semantic_analysis()\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/build.py\", line 1696, in semantic_analysis\r\n self.manager.semantic_analyzer.visit_file(self.tree, self.xpath, self.options, patches)\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py\", line 295, in visit_file\r\n self.accept(d)\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py\", line 3645, in accept\r\n node.accept(self)\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/nodes.py\", line 859, in accept\r\n return visitor.visit_assignment_stmt(self)\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py\", line 1581, in visit_assignment_stmt\r\n self.process_namedtuple_definition(s)\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py\", line 2126, in process_namedtuple_definition\r\n named_tuple = self.check_namedtuple(s.rvalue, name)\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py\", line 2162, in check_namedtuple\r\n info = self.build_namedtuple_typeinfo(name, items, types, {})\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py\", line 2275, in build_namedtuple_typeinfo\r\n info = self.basic_new_typeinfo(name, fallback)\r\n File \"/home/adam/.local/lib/python3.6/site-packages/mypy/semanal.py\", line 2251, in basic_new_typeinfo\r\n info.mro = [info] + basetype_or_fallback.type.mro\r\nTypeError: can only concatenate list (not \"NoneType\") to list\r\n\r\n\r\n```","author":{"url":"https://github.com/rprospero","@type":"Person","name":"rprospero"},"datePublished":"2017-07-31T10:27:25Z","url":"https://github.com/python/mypy/issues/3781"}
| 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:d7c8e7c9-acd8-3436-4610-6c17f17339df |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9494:2A087:1784:1F91:6B00192A |
| html-safe-nonce | b2d19e2fcc64c2e9ceede4badd4ec68a594f72fd9f1adf75e0fe3d4a6c2af8d5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDk0OjJBMDg3OjE3ODQ6MUY5MTo2QjAwMTkyQSIsInZpc2l0b3JfaWQiOiI2MzM1NTI3ODEyMjcwNjU5ODgyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 57ffd34f27435a5c84d7617a5609105de0e44b8c6ed05bc68322355ea092c67a |
| hovercard-subject-tag | issue:246711966 |
| 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/3781/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dd3573bc0048c04b2b30690d8eb016e7dc21221f09f9068e1a61f2f18189032a/python/mypy/issues/3781 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dd3573bc0048c04b2b30690d8eb016e7dc21221f09f9068e1a61f2f18189032a/python/mypy/issues/3781 |
| og:image:alt | The following code caused an internal error on version 0.521. I did a cursory search of the current issue tracker and didn't find anything that matched the simplicity of this case. from collections... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rprospero |
| 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 | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width