Title: incorrect inference of user-defined variadic tuple subtype instances · Issue #19106 · python/mypy · GitHub
Open Graph Title: incorrect inference of user-defined variadic tuple subtype instances · Issue #19106 · python/mypy
X Title: incorrect inference of user-defined variadic tuple subtype instances · Issue #19106 · python/mypy
Description: Instances of user-defined variadic tuples subtypes are inferred incorrectly: class Shape[*Ts](tuple[*Ts]): ... reveal_type((42, )) # tuple[Literal[42]?] reveal_type(Shape((42, ))) # __main__.Shape[Unpack[builtins.tuple[Never, ...]]] http...
Open Graph Description: Instances of user-defined variadic tuples subtypes are inferred incorrectly: class Shape[*Ts](tuple[*Ts]): ... reveal_type((42, )) # tuple[Literal[42]?] reveal_type(Shape((42, ))) # __main__.Shape[...
X Description: Instances of user-defined variadic tuples subtypes are inferred incorrectly: class Shape[*Ts](tuple[*Ts]): ... reveal_type((42, )) # tuple[Literal[42]?] reveal_type(Shape((42, ))) # __main__.Shape[...
Opengraph URL: https://github.com/python/mypy/issues/19106
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"incorrect inference of user-defined variadic tuple subtype instances","articleBody":"Instances of user-defined variadic tuples subtypes are inferred incorrectly:\n\n```python\nclass Shape[*Ts](tuple[*Ts]): ...\n\nreveal_type((42, )) # tuple[Literal[42]?]\nreveal_type(Shape((42, ))) # __main__.Shape[Unpack[builtins.tuple[Never, ...]]]\n```\n\nhttps://mypy-play.net/?mypy=1.15.0&python=3.13&gist=2e2ba990a2112c97ca8d9d071c559a56\n\nIt should instead be inferred as `Shape[Literal[42]]`.\n\nThis occurs with both mypy 1.15 and the current master branch. \n\n---\n\nrelated: #19093, #19105 \nref: https://github.com/python/mypy/pull/19100#issuecomment-2889099140","author":{"url":"https://github.com/jorenham","@type":"Person","name":"jorenham"},"datePublished":"2025-05-18T17:56:29Z","url":"https://github.com/python/mypy/issues/19106"}
| 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:8001530b-38da-8ce0-7934-123474ea993c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C094:1F52F6:5DCD12:7DFA9F:6B003448 |
| html-safe-nonce | bdd800edf56405ee6e7b93919315ad110f6cfa220408883afd277ad57a276d99 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDk0OjFGNTJGNjo1RENEMTI6N0RGQTlGOjZCMDAzNDQ4IiwidmlzaXRvcl9pZCI6Ijc0NTU4MTQwNTUxMjM0OTgwNTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0a718309d0a5acdff1cbb3c3956016ad365ed5ccddc323a9d56d084d9b8e1112 |
| hovercard-subject-tag | issue:3071956650 |
| 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/19106/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5afe40e5550ba28e67ead4274e7d8f619b1af6fdd7c56283e761d238bc5650d6/python/mypy/issues/19106 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5afe40e5550ba28e67ead4274e7d8f619b1af6fdd7c56283e761d238bc5650d6/python/mypy/issues/19106 |
| og:image:alt | Instances of user-defined variadic tuples subtypes are inferred incorrectly: class Shape[*Ts](tuple[*Ts]): ... reveal_type((42, )) # tuple[Literal[42]?] reveal_type(Shape((42, ))) # __main__.Shape[... |
| 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