Title: Empty variadic `tuple` subtype not assignable to `tuple[int, ...]` · Issue #19110 · python/mypy · GitHub
Open Graph Title: Empty variadic `tuple` subtype not assignable to `tuple[int, ...]` · Issue #19110 · python/mypy
X Title: Empty variadic `tuple` subtype not assignable to `tuple[int, ...]` · Issue #19110 · python/mypy
Description: class Shape[*Ts](tuple[*Ts]): ... class Shape0(Shape[()]): ... class Shape1(Shape[int]): ... def rank(shape: tuple[int, ...]) -> int: return len(shape) _ = rank(Shape()) # ✅ _ = rank(()) # ✅ _ = rank(Shape0()) # ❌ Argument 1 to "rank" ha...
Open Graph Description: class Shape[*Ts](tuple[*Ts]): ... class Shape0(Shape[()]): ... class Shape1(Shape[int]): ... def rank(shape: tuple[int, ...]) -> int: return len(shape) _ = rank(Shape()) # ✅ _ = rank(()) # ✅ _ = ra...
X Description: class Shape[*Ts](tuple[*Ts]): ... class Shape0(Shape[()]): ... class Shape1(Shape[int]): ... def rank(shape: tuple[int, ...]) -> int: return len(shape) _ = rank(Shape()) # ✅ _ = rank(()) # ✅ _ =...
Opengraph URL: https://github.com/python/mypy/issues/19110
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Empty variadic `tuple` subtype not assignable to `tuple[int, ...]`","articleBody":"```py\nclass Shape[*Ts](tuple[*Ts]): ...\nclass Shape0(Shape[()]): ...\nclass Shape1(Shape[int]): ...\n\ndef rank(shape: tuple[int, ...]) -> int:\n return len(shape)\n\n_ = rank(Shape()) # ✅\n_ = rank(()) # ✅\n_ = rank(Shape0()) # ❌ Argument 1 to \"rank\" has incompatible type \"Shape0\"; expected \"tuple[int, ...]\"\n_ = rank(Shape1([1])) # ✅\n```\n\n[playground](https://mypy-play.net/?mypy=latest&python=3.13&flags=strict&gist=92dfe89c80f7e34d77d332b26cbfbd40)\n\nPerhaps this is related to #19105, which also involves empty tuple subtypes.\n","author":{"url":"https://github.com/jorenham","@type":"Person","name":"jorenham"},"datePublished":"2025-05-18T23:45:12Z","url":"https://github.com/python/mypy/issues/19110"}
| 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:d5e005bc-6e67-a4d0-8caa-a00e14abcb5c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B19E:2D8919:3DBE70:52FC2E:6B002A96 |
| html-safe-nonce | 3c072bd8230eb9e3612370204e34200d250bdf0802cdce40b034ebe5d9b9a2fc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTlFOjJEODkxOTozREJFNzA6NTJGQzJFOjZCMDAyQTk2IiwidmlzaXRvcl9pZCI6Ijc2NDEyMTgxNDY3OTUyNjg3NTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 30f2df378cf1f2692429f8fb4c0b65d8b19f468331d64485741919f6e96e9953 |
| hovercard-subject-tag | issue:3072139893 |
| 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/19110/issue_layout |
| twitter:image | https://opengraph.githubassets.com/64559037be99184efadb21d66fe687d34448baf183a236f8bdb5fec2ba3da769/python/mypy/issues/19110 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/64559037be99184efadb21d66fe687d34448baf183a236f8bdb5fec2ba3da769/python/mypy/issues/19110 |
| og:image:alt | class Shape[*Ts](tuple[*Ts]): ... class Shape0(Shape[()]): ... class Shape1(Shape[int]): ... def rank(shape: tuple[int, ...]) -> int: return len(shape) _ = rank(Shape()) # ✅ _ = rank(()) # ✅ _ = ra... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jorenham |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width