Title: Exception while typechecking: KeyError: 'typing' · Issue #7412 · python/mypy · GitHub
Open Graph Title: Exception while typechecking: KeyError: 'typing' · Issue #7412 · python/mypy
X Title: Exception while typechecking: KeyError: 'typing' · Issue #7412 · python/mypy
Description: Hello, First, thank you all for your work on MyPy, adding static typing to Python is a huge boon. MyPy is hitting an exception while typechecking our project, both with version 0.720 and with master 0.730+dev.8954045912e8d7f00af5d7d62890...
Open Graph Description: Hello, First, thank you all for your work on MyPy, adding static typing to Python is a huge boon. MyPy is hitting an exception while typechecking our project, both with version 0.720 and with maste...
X Description: Hello, First, thank you all for your work on MyPy, adding static typing to Python is a huge boon. MyPy is hitting an exception while typechecking our project, both with version 0.720 and with maste...
Opengraph URL: https://github.com/python/mypy/issues/7412
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Exception while typechecking: KeyError: 'typing'","articleBody":"Hello,\r\n\r\nFirst, thank you all for your work on MyPy, adding static typing to Python is a huge boon.\r\n\r\nMyPy is hitting an exception while typechecking our project, both with version `0.720` and with master `0.730+dev.8954045912e8d7f00af5d7d6289085dd8eb8c64a` on Python 3.6.5\r\n\r\nThe minimal test case which triggers the exception is: \r\n```Python\r\nimport contextlib\r\n\r\n\r\n@contextlib.contextmanager\r\ndef do_nothing(*args, **kwargs):\r\n yield\r\n```\r\n\r\nWhen evaluated with a config file which contains `follow_imports_for_stubs = True`, as well as passing `--follow-imports=skip` in the commandline. Are these two incompatible? Their names almost suggest as much. \r\n\r\n\r\n\r\nE.g.\r\n```\r\n[mypy]\r\nfollow_imports_for_stubs = True\r\n```\r\n\r\n```bash\r\npython -m mypy --show-traceback --follow-imports=skip --config-file=example.cfg example.py\r\nexample.py:4: error: INTERNAL ERROR -- Please try using mypy master on Github:\r\nhttps://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build\r\nPlease report a bug at https://github.com/python/mypy/issues\r\nversion: 0.730+dev.8954045912e8d7f00af5d7d6289085dd8eb8c64a\r\nTraceback (most recent call last):\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/runpy.py\", line 193, in _run_module_as_main\r\n \"__main__\", mod_spec)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/runpy.py\", line 85, in _run_code\r\n exec(code, run_globals)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/__main__.py\", line 12, in \u003cmodule>\r\n main(None, sys.stdout, sys.stderr)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/main.py\", line 83, in main\r\n res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/build.py\", line 163, in build\r\n result = _build(sources, options, alt_lib_path, flush_errors, fscache, stdout, stderr)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/build.py\", line 225, in _build\r\n graph = dispatch(sources, manager, stdout)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/build.py\", line 2562, in dispatch\r\n process_graph(graph, manager)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/build.py\", line 2871, in process_graph\r\n process_stale_scc(graph, scc, manager)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/build.py\", line 2970, in process_stale_scc\r\n graph[id].type_check_first_pass()\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/build.py\", line 2066, in type_check_first_pass\r\n self.type_checker().check_first_pass()\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py\", line 291, in check_first_pass\r\n self.accept(d)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py\", line 402, in accept\r\n stmt.accept(self)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/nodes.py\", line 756, in accept\r\n return visitor.visit_decorator(self)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py\", line 3294, in visit_decorator\r\n self.check_func_item(e.func, name=e.func.name())\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py\", line 788, in check_func_item\r\n self.check_func_def(defn, typ, name)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py\", line 862, in check_func_def\r\n if not self.is_generator_return_type(typ.ret_type, defn.is_coroutine):\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py\", line 611, in is_generator_return_type\r\n gt = self.named_generic_type('typing.Generator', [any_type, any_type, any_type])\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py\", line 3843, in named_generic_type\r\n info = self.lookup_typeinfo(name)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py\", line 3849, in lookup_typeinfo\r\n sym = self.lookup_qualified(fullname)\r\n File \"/var/lib/conda/envs/py35/lib/python3.6/site-packages/mypy/checker.py\", line 3897, in lookup_qualified\r\n n = self.modules[parts[0]]\r\nKeyError: 'typing'\r\nexample.py:4: : note: use --pdb to drop into pdb\r\n```\r\n","author":{"url":"https://github.com/corydolphin","@type":"Person","name":"corydolphin"},"datePublished":"2019-08-29T17:14:03Z","url":"https://github.com/python/mypy/issues/7412"}
| 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:a4527d37-4115-6e34-e53d-57cecb0e73ff |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C478:2F0104:222D758:2D779A7:6B005754 |
| html-safe-nonce | 11b871029fbf448281260bd5c007d20eb96359acbbc0ebc104443ab4c06cf499 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDc4OjJGMDEwNDoyMjJENzU4OjJENzc5QTc6NkIwMDU3NTQiLCJ2aXNpdG9yX2lkIjoiNDU1MTc3NDA1NjgyNjgyMDQzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ea192fbaab6edaaf499b37c45547a2a29476f9deb075ae8bac1244eed36cc5cb |
| hovercard-subject-tag | issue:487079747 |
| 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/7412/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e47053e890838f76ad611830a0be835ca0da1a57f3e20e4c2e3353759ea7fc33/python/mypy/issues/7412 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e47053e890838f76ad611830a0be835ca0da1a57f3e20e4c2e3353759ea7fc33/python/mypy/issues/7412 |
| og:image:alt | Hello, First, thank you all for your work on MyPy, adding static typing to Python is a huge boon. MyPy is hitting an exception while typechecking our project, both with version 0.720 and with maste... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | corydolphin |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| 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 | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width