Title: `Tuple[...]` is allowed since 3.11+ (gh-31021) · Issue #96792 · python/cpython · GitHub
Open Graph Title: `Tuple[...]` is allowed since 3.11+ (gh-31021) · Issue #96792 · python/cpython
X Title: `Tuple[...]` is allowed since 3.11+ (gh-31021) · Issue #96792 · python/cpython
Description: Before TypeVarTuple support was megred, this is what happened when Tuple[...] was used: Python 3.10.0 (default, Nov 1 2021, 10:24:06) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more...
Open Graph Description: Before TypeVarTuple support was megred, this is what happened when Tuple[...] was used: Python 3.10.0 (default, Nov 1 2021, 10:24:06) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "cop...
X Description: Before TypeVarTuple support was megred, this is what happened when Tuple[...] was used: Python 3.10.0 (default, Nov 1 2021, 10:24:06) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help&q...
Opengraph URL: https://github.com/python/cpython/issues/96792
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`Tuple[...]` is allowed since 3.11+ (gh-31021)","articleBody":"Before `TypeVarTuple` support was megred, this is what happened when `Tuple[...]` was used:\r\n\r\n```\r\nPython 3.10.0 (default, Nov 1 2021, 10:24:06) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n\u003e\u003e\u003e from typing import Tuple\r\n\u003e\u003e\u003e Tuple[...]\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"/Users/sobolev/.pyenv/versions/3.10.0/lib/python3.10/typing.py\", line 309, in inner\r\n return func(*args, **kwds)\r\n File \"/Users/sobolev/.pyenv/versions/3.10.0/lib/python3.10/typing.py\", line 1210, in __getitem__\r\n params = tuple(_type_check(p, msg) for p in params)\r\n File \"/Users/sobolev/.pyenv/versions/3.10.0/lib/python3.10/typing.py\", line 1210, in \u003cgenexpr\u003e\r\n params = tuple(_type_check(p, msg) for p in params)\r\n File \"/Users/sobolev/.pyenv/versions/3.10.0/lib/python3.10/typing.py\", line 173, in _type_check\r\n raise TypeError(f\"{msg} Got {arg!r:.100}.\")\r\nTypeError: Tuple[t0, t1, ...]: each t must be a type. Got Ellipsis.\r\n```\r\n\r\nSince `3.11` it is allowed:\r\n\r\n```\r\nPython 3.12.0a0 (heads/main-dirty:a36235d5c7, Sep 11 2022, 12:23:24) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n\u003e\u003e\u003e from typing import Tuple\r\n\u003e\u003e\u003e Tuple[...]\r\ntyping.Tuple[...]\r\n```\r\n\r\nWhat should we do?\r\n1. Keep this as-is, provide a test that this is allowed (I don't know why anyone would use `tuple[...]`)\r\n2. Make sure that it is still an error with newer version: fix regression and add a test case\r\n\r\nIn both case I would like to send a PR :)\r\n\r\nRelated:\r\n- https://github.com/python/cpython/issues/87390\r\n- https://github.com/python/cpython/pull/31021\r\n\r\nCC @JelleZijlstra and @Fidget-Spinner ","author":{"url":"https://github.com/sobolevn","@type":"Person","name":"sobolevn"},"datePublished":"2022-09-13T11:35:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/96792/cpython/issues/96792"}
| 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:f98adbd6-3ca3-c888-c57b-a983bf33c37d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EDE2:2FF2A3:EBC3E:147895:6969FDA5 |
| html-safe-nonce | c0975dc29f6a421c283811a9b4893c4ab7ef8492b350e4d98463d59c01720088 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFREUyOjJGRjJBMzpFQkMzRToxNDc4OTU6Njk2OUZEQTUiLCJ2aXNpdG9yX2lkIjoiMjE4NzMxMjM1MDM4MzE3NzEyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 20fb9d96160383e0d9338888ac4b4e72e44904ee260dea707eb01962a0ef3247 |
| hovercard-subject-tag | issue:1371304562 |
| 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/cpython/96792/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1522c8edd21c7468bc433f1a41b7b04f8bf5899eb27d3eaa0034ecbfd0698aa1/python/cpython/issues/96792 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1522c8edd21c7468bc433f1a41b7b04f8bf5899eb27d3eaa0034ecbfd0698aa1/python/cpython/issues/96792 |
| og:image:alt | Before TypeVarTuple support was megred, this is what happened when Tuple[...] was used: Python 3.10.0 (default, Nov 1 2021, 10:24:06) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "cop... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sobolevn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width