Title: Incorrect return type for asyncio.gather? · Issue #2652 · python/typeshed · GitHub
Open Graph Title: Incorrect return type for asyncio.gather? · Issue #2652 · python/typeshed
X Title: Incorrect return type for asyncio.gather? · Issue #2652 · python/typeshed
Description: asyncio.gather return type from tasks.pyi seem to be different from the actual runtime type. example.py import asyncio from typing import List async def five() -> int: return 5 async def runner() -> List[int]: fives = await asyncio.gathe...
Open Graph Description: asyncio.gather return type from tasks.pyi seem to be different from the actual runtime type. example.py import asyncio from typing import List async def five() -> int: return 5 async def runner() -...
X Description: asyncio.gather return type from tasks.pyi seem to be different from the actual runtime type. example.py import asyncio from typing import List async def five() -> int: return 5 async def runner(...
Opengraph URL: https://github.com/python/typeshed/issues/2652
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect return type for asyncio.gather?","articleBody":"`asyncio.gather` return type from `tasks.pyi` seem to be different from the actual runtime type.\r\n\r\n**example.py**\r\n```python\r\nimport asyncio\r\nfrom typing import List\r\n\r\nasync def five() -> int:\r\n return 5\r\n\r\nasync def runner() -> List[int]:\r\n fives = await asyncio.gather(five(), five(), five())\r\n print(type(fives)) # prints `\u003cclass 'list'>`\r\n print(fives) # prints `[5, 5, 5]`\r\n return fives\r\n\r\nloop = asyncio.get_event_loop()\r\nresult: List[int] = loop.run_until_complete(runner())\r\n```\r\n```\r\n$ python3 --version\r\nPython 3.6.6\r\n$ python3 example.py \r\n\u003cclass 'list'>\r\n[5, 5, 5]\r\n$ mypy --version\r\nmypy 0.641\r\n$ mypy example.py \r\nexample.py:11: error: Incompatible return value type (got \"Tuple[int, int, int]\", expected \"List[int]\")\r\n```\r\n\r\nBy looking at `tasks.pyi` I see no overload or any case where `gather` does not return a `Tuple`.\r\n","author":{"url":"https://github.com/s-kovacevic","@type":"Person","name":"s-kovacevic"},"datePublished":"2018-11-29T14:55:56Z","url":"https://github.com/python/typeshed/issues/2652"}
| 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:5c17a781-4a23-1325-63ad-b1a038b4792d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E282:37BEAD:207381B:2C2DCBD:6B001FB5 |
| html-safe-nonce | 2e9e5ed67fc5a360ed1092a034c5cd249360d13c5afa36daa49bb0081d2f6083 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjgyOjM3QkVBRDoyMDczODFCOjJDMkRDQkQ6NkIwMDFGQjUiLCJ2aXNpdG9yX2lkIjoiNjQzODUzMzQ5MzIzOTU4Njc0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c3c8c17553ed3c7f6762e982761acfa44fd889bdbb8084c0e38dbb37304b48ee |
| hovercard-subject-tag | issue:385774631 |
| 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/typeshed/2652/issue_layout |
| twitter:image | https://opengraph.githubassets.com/86a84bc0f43a22f5560931e625f273f0c6278cdb62db2295f9f9eeee97a8d846/python/typeshed/issues/2652 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/86a84bc0f43a22f5560931e625f273f0c6278cdb62db2295f9f9eeee97a8d846/python/typeshed/issues/2652 |
| og:image:alt | asyncio.gather return type from tasks.pyi seem to be different from the actual runtime type. example.py import asyncio from typing import List async def five() -> int: return 5 async def runner() -... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | s-kovacevic |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| 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