René's URL Explorer Experiment


Title: `class S(tuple[*tuple[()]])` crashes mypy · Issue #19105 · python/mypy · GitHub

Open Graph Title: `class S(tuple[*tuple[()]])` crashes mypy · Issue #19105 · python/mypy

X Title: `class S(tuple[*tuple[()]])` crashes mypy · Issue #19105 · python/mypy

Description: class S(tuple[*tuple[()]]): ... mypy 1.15 stacktrace (mypy-play): Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/layers/google.python.pip/pip...

Open Graph Description: class S(tuple[*tuple[()]]): ... mypy 1.15 stacktrace (mypy-play): Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_...

X Description: class S(tuple[*tuple[()]]): ... mypy 1.15 stacktrace (mypy-play): Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen ru...

Opengraph URL: https://github.com/python/mypy/issues/19105

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`class S(tuple[*tuple[()]])` crashes mypy","articleBody":"```py\nclass S(tuple[*tuple[()]]): ...\n```\n\nmypy 1.15 stacktrace ([mypy-play](https://mypy-play.net/?mypy=latest&python=3.13&gist=c73a206345ae50e7d35d512d773830ba)):\n\n```pytb\nTraceback (most recent call last):\n  File \"\u003cfrozen runpy>\", line 198, in _run_module_as_main\n  File \"\u003cfrozen runpy>\", line 88, in _run_code\n  File \"/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/__main__.py\", line 37, in \u003cmodule>\n    console_entry()\n  File \"/layers/google.python.pip/pip/lib/python3.12/site-packages/mypy/__main__.py\", line 15, in console_entry\n    main()\n  File \"mypy/main.py\", line 119, in main\n  File \"mypy/main.py\", line 203, in run_build\n  File \"mypy/build.py\", line 191, in build\n  File \"mypy/build.py\", line 267, in _build\n  File \"mypy/build.py\", line 2937, in dispatch\n  File \"mypy/build.py\", line 3335, in process_graph\n  File \"mypy/build.py\", line 3430, in process_stale_scc\n  File \"mypy/semanal_main.py\", line 97, in semantic_analysis_for_scc\n  File \"mypy/semanal.py\", line 7621, in apply_semantic_analyzer_patches\n  File \"mypy/semanal.py\", line 2587, in \u003clambda>\n  File \"mypy/semanal_shared.py\", line 305, in calculate_tuple_fallback\nNotImplementedError\n```\n\nand on current `master` ([mypy-play](https://mypy-play.net/?mypy=master&python=3.13&gist=c73a206345ae50e7d35d512d773830ba))\n\n```pytb\nTraceback (most recent call last):\n  File \"\u003cfrozen runpy>\", line 198, in _run_module_as_main\n  File \"\u003cfrozen runpy>\", line 88, in _run_code\n  File \"mypy/__main__.py\", line 37, in \u003cmodule>\n    console_entry()\n  File \"mypy/__main__.py\", line 15, in console_entry\n    main()\n  File \"mypy/main.py\", line 127, in main\n    res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)\n                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"mypy/main.py\", line 211, in run_build\n    res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\n          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"mypy/build.py\", line 191, in build\n    result = _build(\n             ^^^^^^^\n  File \"mypy/build.py\", line 267, in _build\n    graph = dispatch(sources, manager, stdout)\n            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"mypy/build.py\", line 2939, in dispatch\n    process_graph(graph, manager)\n  File \"mypy/build.py\", line 3337, in process_graph\n    process_stale_scc(graph, scc, manager)\n  File \"mypy/build.py\", line 3432, in process_stale_scc\n    mypy.semanal_main.semantic_analysis_for_scc(graph, scc, manager.errors)\n  File \"mypy/semanal_main.py\", line 99, in semantic_analysis_for_scc\n    apply_semantic_analyzer_patches(patches)\n  File \"mypy/semanal.py\", line 7740, in apply_semantic_analyzer_patches\n    patch_func()\n  File \"mypy/semanal.py\", line 2630, in \u003clambda>\n    self.schedule_patch(PRIORITY_FALLBACKS, lambda: calculate_tuple_fallback(base))\n                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"mypy/semanal_shared.py\", line 305, in calculate_tuple_fallback\n    raise NotImplementedError\n```\n\n\n---\n\nanother way to trigger this crash is through a typo in the variadic type parameter name:\n\n```pyi\nclass MyTuple[*Ts](tuple[*_Ts]): ...  # oh no a typo\n```\n\nthis produces an identical stacktrace ([mypy-play](https://mypy-play.net/?mypy=latest&python=3.13&gist=d690a693b10435804af10f9ed9a270c4))\n\n---\n\nsome observations:\n\n- it doesn't matter if `typing.Unpack` is used instead of `*`\n- I checked all versions from 1.9.0-master, and all crash in the same way\n- `class S(tuple[()]): ...` does not cause a crash \n  (although `S()` is [revealed as](https://mypy-play.net/?mypy=latest&python=3.13&gist=08f4af8a360ea5b743c0c49bce719052) `tuple[(), fallback=__main__.S]`, which is kinda sus)\n- in case you didn't notice; the first example is valid at runtime, the second isn't\n- my ear is a bit itchy\n\nAnd it's probably not what you want to hear, but it might be relevant info, so I'll carefully whisper it: \u003csub>Pyright does not have this problem ([playground 1](https://pyright-play.net/?pythonVersion=3.14&strict=true&code=MYGwhgzhAEDKAUAXArgBxAUwNoCoXu3gEoBdEogLmgDpaAoIA), [playground 2](https://pyright-play.net/?pythonVersion=3.14&strict=true&code=MYGwhgzhAECyCeAVArgBxAUwNoCpEQF0AKAFzU1wH18CBKALmgDoXpoBiaAewAtoA7LtDDQS8VFwBQQA)), and the same goes for ty ([playground 1](https://play.ty.dev/93a8653a-9a6e-4a45-8016-ecade3dd638e), [playground 2](https://play.ty.dev/7aff606b-a731-4958-8b4b-80f06e286c10))\u003c/sub>\n\n---\n\nref: https://github.com/python/mypy/pull/19100#issuecomment-2889099140","author":{"url":"https://github.com/jorenham","@type":"Person","name":"jorenham"},"datePublished":"2025-05-18T17:46:14Z","url":"https://github.com/python/mypy/issues/19105"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:dbc799c8-97b0-a51d-574a-08288a8f61fd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC006:177D5B:32184E3:424E8B3:6B0032D3
html-safe-nonce797810e74e7f807f2d464314b42dba8418d599d3488c6cedca16d951ff38b7ad
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDA2OjE3N0Q1QjozMjE4NEUzOjQyNEU4QjM6NkIwMDMyRDMiLCJ2aXNpdG9yX2lkIjoiMTQxODMxNjc4MjY4NjQ1MDM4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb73627721754c0c447e113a5e89a5d6d600e8756e51784e0425b3580e0abe1fa
hovercard-subject-tagissue:3071950726
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/mypy/19105/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2e7d6e9d472a470c76f6a2964c0d775f5bd296ea9617b0c8176b50f10b534d7b/python/mypy/issues/19105
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2e7d6e9d472a470c76f6a2964c0d775f5bd296ea9617b0c8176b50f10b534d7b/python/mypy/issues/19105
og:image:altclass S(tuple[*tuple[()]]): ... mypy 1.15 stacktrace (mypy-play): Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejorenham
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
turbo-cache-controlno-preview
go-importgithub.com/python/mypy git https://github.com/python/mypy.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id7053637
octolytics-dimension-repository_nwopython/mypy
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7053637
octolytics-dimension-repository_network_root_nwopython/mypy
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef3f3a43ca095cdea3abbb394112e971f9fdb94fa
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/19105#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F19105
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F19105
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fmypy
Reloadhttps://github.com/python/mypy/issues/19105
Reloadhttps://github.com/python/mypy/issues/19105
Reloadhttps://github.com/python/mypy/issues/19105
pythonhttps://github.com/python
mypyhttps://github.com/python/mypy
Codehttps://github.com/python/mypy
Issues2.7k (2.7k)https://github.com/python/mypy/issues
Pull requests546 (546)https://github.com/python/mypy/pulls
Actionshttps://github.com/python/mypy/actions
Projectshttps://github.com/python/mypy/projects
Wikihttps://github.com/python/mypy/wiki
Security and qualityhttps://github.com/python/mypy/security
Insightshttps://github.com/python/mypy/insights
https://github.com/python/mypy
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/19105
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/19105
#19111https://github.com/python/mypy/pull/19111
class S(tuple[*tuple[()]]) crashes mypyhttps://github.com/python/mypy/issues/19105#top
#19111https://github.com/python/mypy/pull/19111
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
topic-pep-646PEP 646 (TypeVarTuple, Unpack)https://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-pep-646%22
https://github.com/jorenham
jorenhamhttps://github.com/jorenham
on May 18, 2025https://github.com/python/mypy/issues/19105#issue-3071950726
mypy-playhttps://mypy-play.net/?mypy=latest&python=3.13&gist=c73a206345ae50e7d35d512d773830ba
mypy-playhttps://mypy-play.net/?mypy=master&python=3.13&gist=c73a206345ae50e7d35d512d773830ba
mypy-playhttps://mypy-play.net/?mypy=latest&python=3.13&gist=d690a693b10435804af10f9ed9a270c4
revealed ashttps://mypy-play.net/?mypy=latest&python=3.13&gist=08f4af8a360ea5b743c0c49bce719052
playground 1https://pyright-play.net/?pythonVersion=3.14&strict=true&code=MYGwhgzhAEDKAUAXArgBxAUwNoCoXu3gEoBdEogLmgDpaAoIA
playground 2https://pyright-play.net/?pythonVersion=3.14&strict=true&code=MYGwhgzhAECyCeAVArgBxAUwNoCpEQF0AKAFzU1wH18CBKALmgDoXpoBiaAewAtoA7LtDDQS8VFwBQQA
playground 1https://play.ty.dev/93a8653a-9a6e-4a45-8016-ecade3dd638e
playground 2https://play.ty.dev/7aff606b-a731-4958-8b4b-80f06e286c10
#19100 (comment)https://github.com/python/mypy/pull/19100#issuecomment-2889099140
jorenhamhttps://github.com/jorenham
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
on May 18, 2025https://github.com/python/mypy/issues/19105#event-17704115811
jorenhamhttps://github.com/jorenham
on May 18, 2025https://github.com/python/mypy/issues/19105#event-17704116453
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
on May 19, 2025https://github.com/python/mypy/issues/19105#issuecomment-2889337317
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
on May 19, 2025https://github.com/python/mypy/issues/19105#issuecomment-2889369060
sterliakovhttps://github.com/sterliakov
topic-pep-646PEP 646 (TypeVarTuple, Unpack)https://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-pep-646%22
on May 19, 2025https://github.com/python/mypy/issues/19105#event-17705524138
sterliakovhttps://github.com/sterliakov
on Jul 4, 2025https://github.com/python/mypy/issues/19105#event-18471000019
Merge remote-tracking branch 'upstream/master' into bugfix/pythongh-1…https://github.com/sterliakov/mypy/commit/3989212f5a774f4f9644710f88f215272b35a7ab
pythongh-1…https://github.com/python/mypy/issues/19105
3989212https://github.com/sterliakov/mypy/commit/3989212f5a774f4f9644710f88f215272b35a7ab
sterliakovhttps://github.com/sterliakov
on Jul 21, 2025https://github.com/python/mypy/issues/19105#event-18734279064
Merge branch 'master' into bugfix/pythongh-19105-trivial-unpack-in-ba…https://github.com/sterliakov/mypy/commit/03a0a5b3644234fd58c6ca0ae33452126ebee12d
pythongh-19105https://github.com/python/mypy/issues/19105
03a0a5bhttps://github.com/sterliakov/mypy/commit/03a0a5b3644234fd58c6ca0ae33452126ebee12d
ilevkivskyihttps://github.com/ilevkivskyi
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#19111https://github.com/python/mypy/pull/19111
on Jul 22, 2025https://github.com/python/mypy/issues/19105#event-18762695257
ilevkivskyihttps://github.com/ilevkivskyi
on Jul 22, 2025https://github.com/python/mypy/issues/19105#event-18762695291
Use normalized tuples for fallback calculation (#19111)https://github.com/python/mypy/commit/2e5d7eecd7673f9098f54505e68444762855d812
#19111https://github.com/python/mypy/pull/19111
https://docs.github.com/articles/closing-issues-via-commit-messages
2e5d7eehttps://github.com/python/mypy/commit/2e5d7eecd7673f9098f54505e68444762855d812
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/19105
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/19105
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
topic-pep-646PEP 646 (TypeVarTuple, Unpack)https://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-pep-646%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.