Title: concurrent.futures.wait should return a NamedTuple · Issue #3380 · python/typeshed · GitHub
Open Graph Title: concurrent.futures.wait should return a NamedTuple · Issue #3380 · python/typeshed
X Title: concurrent.futures.wait should return a NamedTuple · Issue #3380 · python/typeshed
Description: Currently, the type of concurrent.futures.wait in typeshed is as follows: def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], Set[Future[_T]]]: ... According to Python's do...
Open Graph Description: Currently, the type of concurrent.futures.wait in typeshed is as follows: def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], Set[Fu...
X Description: Currently, the type of concurrent.futures.wait in typeshed is as follows: def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], Set...
Opengraph URL: https://github.com/python/typeshed/issues/3380
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"concurrent.futures.wait should return a NamedTuple","articleBody":"Currently, the type of `concurrent.futures.wait` in typeshed is as follows:\r\n\r\n```python\r\ndef wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]],\r\n Set[Future[_T]]]: ...\r\n```\r\n\r\nAccording to [Python's documentation](https://docs.python.org/3/library/concurrent.futures.html):\r\n\r\n> Returns a named 2-tuple of sets. The first set, named done, contains the futures that completed (finished or cancelled futures) before the wait completed. The second set, named not_done, contains the futures that did not complete (pending or running futures).\r\n\r\nSo the type should really be:\r\n\r\n```python\r\nclass DoneAndNotDoneFutures(Generic[_T], NamedTuple):\r\n done: Set[Future[_T]]\r\n not_done: Set[Future[_T]]\r\n\r\ndef wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> DoneAndNotDoneFutures[_T]: ...\r\n```\r\n\r\n(the name of the NamedTuple is taken from CPython's implementation of `concurrent.futures`)\r\n\r\nUnfortunately, generic NamedTuples are [not currently supported by mypy](https://github.com/python/mypy/issues/685), so that change would break the tests.","author":{"url":"https://github.com/Phlogistique","@type":"Person","name":"Phlogistique"},"datePublished":"2019-10-17T14:06:33Z","url":"https://github.com/python/typeshed/issues/3380"}
| 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:7f69f6c5-55dc-04ee-39ca-fe0f36a278af |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 830C:30CC09:22C820C:2F030C7:6B0021FE |
| html-safe-nonce | 0bc54c373f62773d47747b6c8a6d5bfa0a46194af0def84a8717264fd7a9fbcd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzBDOjMwQ0MwOToyMkM4MjBDOjJGMDMwQzc6NkIwMDIxRkUiLCJ2aXNpdG9yX2lkIjoiNTE1MzM3NTA5MDk1OTcyMDk1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 30ac7a22c5bcbfd98df126fdea8c1a6451091da85a69329258316f06a518d712 |
| hovercard-subject-tag | issue:508501136 |
| 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/3380/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0f46b2ffee43feb8bec0fb93092ad933bab3539d1464c3cf3be292892450b665/python/typeshed/issues/3380 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0f46b2ffee43feb8bec0fb93092ad933bab3539d1464c3cf3be292892450b665/python/typeshed/issues/3380 |
| og:image:alt | Currently, the type of concurrent.futures.wait in typeshed is as follows: def wait(fs: Iterable[Future[_T]], timeout: Optional[float] = ..., return_when: str = ...) -> Tuple[Set[Future[_T]], Set[Fu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Phlogistique |
| 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