Title: Crash with async generator and disallow_untyped_defs · Issue #5122 · python/mypy · GitHub
Open Graph Title: Crash with async generator and disallow_untyped_defs · Issue #5122 · python/mypy
X Title: Crash with async generator and disallow_untyped_defs · Issue #5122 · python/mypy
Description: On this file: from typing import AsyncGenerator, Awaitable, Callable, Any import asyncio async def f() -> AsyncGenerator[int, None]: yield 3 await asyncio.sleep(1) I get: $ mypy --show-traceback --disallow-untyped-defs bin/asyncg.py bin/...
Open Graph Description: On this file: from typing import AsyncGenerator, Awaitable, Callable, Any import asyncio async def f() -> AsyncGenerator[int, None]: yield 3 await asyncio.sleep(1) I get: $ mypy --show-traceback --...
X Description: On this file: from typing import AsyncGenerator, Awaitable, Callable, Any import asyncio async def f() -> AsyncGenerator[int, None]: yield 3 await asyncio.sleep(1) I get: $ mypy --show-traceback...
Opengraph URL: https://github.com/python/mypy/issues/5122
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash with async generator and disallow_untyped_defs","articleBody":"On this file:\r\n\r\n```python\r\nfrom typing import AsyncGenerator, Awaitable, Callable, Any\r\nimport asyncio\r\n\r\nasync def f() -> AsyncGenerator[int, None]:\r\n yield 3\r\n await asyncio.sleep(1)\r\n```\r\n\r\nI get:\r\n```\r\n$ mypy --show-traceback --disallow-untyped-defs bin/asyncg.py \r\nbin/asyncg.py:4: error: INTERNAL ERROR -- please report a bug at https://github.com/python/mypy/issues version: 0.610+dev-c29210ea2f79f4017ec68435b5674d56e87c5105\r\nTraceback (most recent call last):\r\n File \"/Users/jzijlstra-mpbt/py/venvs/venv36/bin/mypy\", line 11, in \u003cmodule>\r\n load_entry_point('mypy', 'console_scripts', 'mypy')()\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/__main__.py\", line 7, in console_entry\r\n main(None)\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/main.py\", line 91, in main\r\n res = type_check_only(sources, bin_dir, options, flush_errors, fscache) # noqa\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/main.py\", line 148, in type_check_only\r\n fscache=fscache)\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/build.py\", line 185, in build\r\n flush_errors, fscache)\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/build.py\", line 285, in _build\r\n graph = dispatch(sources, manager)\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/build.py\", line 2398, in dispatch\r\n process_graph(graph, manager)\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/build.py\", line 2691, in process_graph\r\n process_stale_scc(graph, scc, manager)\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/build.py\", line 2807, in process_stale_scc\r\n graph[id].type_check_first_pass()\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/build.py\", line 2029, in type_check_first_pass\r\n self.type_checker().check_first_pass()\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/checker.py\", line 252, in check_first_pass\r\n self.accept(d)\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/checker.py\", line 351, in accept\r\n stmt.accept(self)\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/nodes.py\", line 586, in accept\r\n return visitor.visit_func_def(self)\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/checker.py\", line 654, in visit_func_def\r\n self._visit_func_def(defn)\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/checker.py\", line 658, in _visit_func_def\r\n self.check_func_item(defn, name=defn.name())\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/checker.py\", line 720, in check_func_item\r\n self.check_func_def(defn, typ, name)\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/checker.py\", line 755, in check_func_def\r\n self.check_for_missing_annotations(fdef)\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/checker.py\", line 933, in check_for_missing_annotations\r\n is_unannotated_any(self.get_coroutine_return_type(ret_type))):\r\n File \"/Users/jzijlstra-mpbt/py/mypy/mypy/checker.py\", line 626, in get_coroutine_return_type\r\n return return_type.args[2]\r\nIndexError: list index out of range\r\nbin/asyncg.py:4: : note: use --pdb to drop into pdb\r\n```\r\n\r\nIf nobody else gets to it first, I can look into fixing this within the next few days.","author":{"url":"https://github.com/JelleZijlstra","@type":"Person","name":"JelleZijlstra"},"datePublished":"2018-05-30T20:52:01Z","url":"https://github.com/python/mypy/issues/5122"}
| 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:6783fcec-c02b-5e53-d7a8-c5d360650e4d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E424:22BD05:2047807:2BAEA4F:6B001C78 |
| html-safe-nonce | 125c4f72cbb6066c1f345fd992c66e1aa26ef6487eb89a3c4a9dfda7172e640d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDI0OjIyQkQwNToyMDQ3ODA3OjJCQUVBNEY6NkIwMDFDNzgiLCJ2aXNpdG9yX2lkIjoiMjAyNzgzNTMyNzAzNjUyOTc4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8a13251994719812d4f018f80197b4cb831642dc51d26f68152a13efa480c8ed |
| hovercard-subject-tag | issue:327894591 |
| 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/5122/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7bfad6add6d52681b41d5a316747e49389f8eacad2c8e741adbede4ed18962f9/python/mypy/issues/5122 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7bfad6add6d52681b41d5a316747e49389f8eacad2c8e741adbede4ed18962f9/python/mypy/issues/5122 |
| og:image:alt | On this file: from typing import AsyncGenerator, Awaitable, Callable, Any import asyncio async def f() -> AsyncGenerator[int, None]: yield 3 await asyncio.sleep(1) I get: $ mypy --show-traceback --... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JelleZijlstra |
| 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