Title: Assertion error, importing library with typehints · Issue #8481 · python/mypy · GitHub
Open Graph Title: Assertion error, importing library with typehints · Issue #8481 · python/mypy
X Title: Assertion error, importing library with typehints · Issue #8481 · python/mypy
Description: Note: if you are reporting a wrong signature of a function or a class in the standard library, then the typeshed tracker is better suited for this report: https://github.com/python/typeshed/issues Please provide more information to help ...
Open Graph Description: Note: if you are reporting a wrong signature of a function or a class in the standard library, then the typeshed tracker is better suited for this report: https://github.com/python/typeshed/issues ...
X Description: Note: if you are reporting a wrong signature of a function or a class in the standard library, then the typeshed tracker is better suited for this report: https://github.com/python/typeshed/issues ...
Opengraph URL: https://github.com/python/mypy/issues/8481
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Assertion error, importing library with typehints","articleBody":"Note: if you are reporting a wrong signature of a function or a class in\r\nthe standard library, then the typeshed tracker is better suited\r\nfor this report: https://github.com/python/typeshed/issues\r\n\r\nPlease provide more information to help us understand the issue:\r\n\r\n* Are you reporting a bug, or opening a feature request?\r\nBug, assertionerror\r\n* Please insert below the code you are checking with mypy,\r\n or a mock-up repro if the source is private. We would appreciate\r\n if you try to simplify your case to a minimal repro.\r\n\r\nLibrary used https://github.com/Rapptz/discord.py/pull/1497. \r\n\r\nCode\r\n```\r\nimport discord\r\n```\r\n\r\nRunning mypy --strict file.py crashes it but if you do normal run without strict and then strict it works until you do strict again. It seems doing strict off the bat without having ran without --strict previous crashes it. \r\n\r\nTraceback\r\n\r\n```py\r\nTraceback (most recent call last):\r\n File \"C:\\Python38\\lib\\runpy.py\", line 193, in _run_module_as_main\r\n return _run_code(code, main_globals, None,\r\n File \"C:\\Python38\\lib\\runpy.py\", line 86, in _run_code\r\n exec(code, run_globals)\r\n File \"C:\\stonedestroyer\\bot\\.venv\\Scripts\\mypy.exe\\__main__.py\", line 7, in \u003cmodule>\r\n File \"c:\\stonedestroyer\\bot\\.venv\\lib\\site-packages\\mypy\\__main__.py\", line 8, in console_entry\r\n main(None, sys.stdout, sys.stderr)\r\n File \"c:\\stonedestroyer\\bot\\.venv\\lib\\site-packages\\mypy\\main.py\", line 89, in main\r\n res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\r\n File \"c:\\stonedestroyer\\bot\\.venv\\lib\\site-packages\\mypy\\build.py\", line 180, in build\r\n result = _build(\r\n File \"c:\\stonedestroyer\\bot\\.venv\\lib\\site-packages\\mypy\\build.py\", line 249, in _build\r\n graph = dispatch(sources, manager, stdout)\r\n File \"c:\\stonedestroyer\\bot\\.venv\\lib\\site-packages\\mypy\\build.py\", line 2649, in dispatch\r\n process_graph(graph, manager)\r\n File \"c:\\stonedestroyer\\bot\\.venv\\lib\\site-packages\\mypy\\build.py\", line 2956, in process_graph\r\n process_stale_scc(graph, scc, manager)\r\n File \"c:\\stonedestroyer\\bot\\.venv\\lib\\site-packages\\mypy\\build.py\", line 3074, in process_stale_scc\r\n graph[id].write_cache()\r\n File \"c:\\stonedestroyer\\bot\\.venv\\lib\\site-packages\\mypy\\build.py\", line 2266, in write_cache\r\n new_interface_hash, self.meta = write_cache(\r\n File \"c:\\stonedestroyer\\bot\\.venv\\lib\\site-packages\\mypy\\build.py\", line 1441, in write_cache\r\n data = tree.serialize()\r\n File \"c:\\stonedestroyer\\bot\\.venv\\lib\\site-packages\\mypy\\nodes.py\", line 302, in serialize\r\n 'names': self.names.serialize(self._fullname),\r\n File \"c:\\stonedestroyer\\bot\\.venv\\lib\\site-packages\\mypy\\nodes.py\", line 3097, in serialize\r\n data[key] = value.serialize(fullname, key)\r\n File \"c:\\stonedestroyer\\bot\\.venv\\lib\\site-packages\\mypy\\nodes.py\", line 3033, in serialize\r\n assert not isinstance(self.node, PlaceholderNode)\r\nAssertionError\r\n\r\n```\r\n\r\nSame issue with latest mypy from master.\r\n\r\n","author":{"url":"https://github.com/Stonedestroyer","@type":"Person","name":"Stonedestroyer"},"datePublished":"2020-03-03T07:38:00Z","url":"https://github.com/python/mypy/issues/8481"}
| 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:530d8312-6c6b-088f-a7c4-d6aaf602f2ff |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BFF4:34D604:15D4F70:1CCB134:6B001B2D |
| html-safe-nonce | 4927192188f5a55a8af2ad1fea2f7b6b48634da07936025c11efc79d51f503d3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkY0OjM0RDYwNDoxNUQ0RjcwOjFDQ0IxMzQ6NkIwMDFCMkQiLCJ2aXNpdG9yX2lkIjoiODU3NTUzNDc3MTA0MjUyMzk0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0201307bef2f18f07cd99a6e7f2ec7c0619e7db99711d15b5e78cbb16e479495 |
| hovercard-subject-tag | issue:574474057 |
| 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/8481/issue_layout |
| twitter:image | https://opengraph.githubassets.com/42e8bb9c91940e07cf5c0847134f1669b25b28f6d622363e089b2f7e90aba45b/python/mypy/issues/8481 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/42e8bb9c91940e07cf5c0847134f1669b25b28f6d622363e089b2f7e90aba45b/python/mypy/issues/8481 |
| og:image:alt | Note: if you are reporting a wrong signature of a function or a class in the standard library, then the typeshed tracker is better suited for this report: https://github.com/python/typeshed/issues ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Stonedestroyer |
| 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