René's URL Explorer Experiment


Title: Crash on code mixing instances and type typed variables · Issue #20526 · python/mypy · GitHub

Open Graph Title: Crash on code mixing instances and type typed variables · Issue #20526 · python/mypy

X Title: Crash on code mixing instances and type typed variables · Issue #20526 · python/mypy

Description: Crash Report INTERNAL ERROR Traceback mwe-mypy2.py:19: error: INTERNAL ERROR -- Please try using mypy master on GitHub: https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build Please report a bug at https:...

Open Graph Description: Crash Report INTERNAL ERROR Traceback mwe-mypy2.py:19: error: INTERNAL ERROR -- Please try using mypy master on GitHub: https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-...

X Description: Crash Report INTERNAL ERROR Traceback mwe-mypy2.py:19: error: INTERNAL ERROR -- Please try using mypy master on GitHub: https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash on code mixing instances and type typed variables","articleBody":"\u003c!--\n  Use this form only if mypy reports an \"INTERNAL ERROR\" and/or gives a traceback.\n  Please include the traceback and all other messages below (use `mypy --show-traceback`).\n-->\n\n**Crash Report**\n\nINTERNAL ERROR\n\n**Traceback**\n\n```python-traceback\nmwe-mypy2.py:19: error: INTERNAL ERROR -- Please try using mypy master on GitHub:\nhttps://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build\nPlease report a bug at https://github.com/python/mypy/issues\nversion: 1.20.0+dev.56c33f251cb6b3791297fdaa57453d4afaa8c4dc\nTraceback (most recent call last):\n  File \"/home/.../.venv/bin/mypy\", line 8, in \u003cmodule>\n    sys.exit(console_entry())\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/__main__.py\", line 15, in console_entry\n    main()\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/main.py\", line 135, in main\n    res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/main.py\", line 219, in run_build\n    res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/build.py\", line 320, in build\n    result = build_inner(\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/build.py\", line 417, in build_inner\n    graph = dispatch(sources, manager, stdout)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/build.py\", line 3178, in dispatch\n    process_graph(graph, manager)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/build.py\", line 3588, in process_graph\n    done, still_working, results = manager.wait_for_done(graph)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/build.py\", line 1070, in wait_for_done\n    process_stale_scc(graph, next_scc, self)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/build.py\", line 3752, in process_stale_scc\n    graph[id].type_check_first_pass()\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/build.py\", line 2543, in type_check_first_pass\n    self.type_checker().check_first_pass()\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checker.py\", line 530, in check_first_pass\n    self.accept(d)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checker.py\", line 641, in accept\n    stmt.accept(self)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/nodes.py\", line 1004, in accept\n    return visitor.visit_func_def(self)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checker.py\", line 1198, in visit_func_def\n    self._visit_func_def(defn)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checker.py\", line 1202, in _visit_func_def\n    self.check_func_item(defn, name=defn.name)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checker.py\", line 1237, in check_func_item\n    self.check_func_def(defn, typ, name, allow_empty)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checker.py\", line 1510, in check_func_def\n    self.accept(item.body)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checker.py\", line 641, in accept\n    stmt.accept(self)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/nodes.py\", line 1582, in accept\n    return visitor.visit_block(self)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checker.py\", line 3159, in visit_block\n    self.accept(s)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checker.py\", line 641, in accept\n    stmt.accept(self)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/nodes.py\", line 1669, in accept\n    return visitor.visit_assignment_stmt(self)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checker.py\", line 3212, in visit_assignment_stmt\n    self.check_assignment(s.lvalues[-1], s.rvalue, s.type is None, s.new_syntax)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checker.py\", line 3387, in check_assignment\n    rvalue_type, lvalue_type = self.check_simple_assignment(\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checker.py\", line 4668, in check_simple_assignment\n    rvalue_type = self.expr_checker.accept(\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checkexpr.py\", line 6081, in accept\n    typ = self.accept_maybe_cache(node, type_context=type_context)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checkexpr.py\", line 6116, in accept_maybe_cache\n    typ = node.accept(self)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/nodes.py\", line 2298, in accept\n    return visitor.visit_call_expr(self)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checkexpr.py\", line 508, in visit_call_expr\n    return self.visit_call_expr_inner(e, allow_none_return=allow_none_return)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checkexpr.py\", line 645, in visit_call_expr_inner\n    ret_type = self.check_call_expr_with_callee_type(\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checkexpr.py\", line 1495, in check_call_expr_with_callee_type\n    ret_type, callee_type = self.check_call(\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checkexpr.py\", line 1588, in check_call\n    return self.check_callable_call(\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checkexpr.py\", line 1799, in check_callable_call\n    arg_types = self.infer_arg_types_in_context(callee, args, arg_kinds, formal_to_actual)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checkexpr.py\", line 1973, in infer_arg_types_in_context\n    res[ai] = self.accept(args[ai], arg_type)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checkexpr.py\", line 6083, in accept\n    typ = node.accept(self)  # r-value type, when interpreted as a value expression\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/nodes.py\", line 2198, in accept\n    return visitor.visit_name_expr(self)\n           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checkexpr.py\", line 357, in visit_name_expr\n    narrowed = self.narrow_type_from_binder(e, result)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/checkexpr.py\", line 6394, in narrow_type_from_binder\n    narrowed = narrow_declared_type(known_type, restriction)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/meet.py\", line 141, in narrow_declared_type\n    narrow_declared_type(d, n)\n    ~~~~~~~~~~~~~~~~~~~~^^^^^^\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/meet.py\", line 222, in narrow_declared_type\n    return meet_types(original_declared, original_narrowed)\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/meet.py\", line 113, in meet_types\n    return t.accept(TypeMeetVisitor(s))\n           ~~~~~~~~^^^^^^^^^^^^^^^^^^^^\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/types.py\", line 2846, in accept\n    return visitor.visit_tuple_type(self)\n           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/meet.py\", line 1079, in visit_tuple_type\n    return t.copy_modified(items=[meet_types(it, self.s.args[0]) for it in t.items])\n                                  ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^mwe-mypy2.py:19: : note: use --pdb to drop into pdb\n\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/meet.py\", line 113, in meet_types\n    return t.accept(TypeMeetVisitor(s))\n           ~~~~~~~~^^^^^^^^^^^^^^^^^^^^\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/types.py\", line 3416, in accept\n    return visitor.visit_union_type(self)\n           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/meet.py\", line 793, in visit_union_type\n    meets = [meet_types(x, self.s) for x in t.items]\n             ~~~~~~~~~~^^^^^^^^^^^\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/meet.py\", line 113, in meet_types\n    return t.accept(TypeMeetVisitor(s))\n           ~~~~~~~~^^^^^^^^^^^^^^^^^^^^\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/types.py\", line 1250, in accept\n    return visitor.visit_unpack_type(self)\n           ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^\n  File \"/home/.../.venv/lib/python3.13/site-packages/mypy/meet.py\", line 845, in visit_unpack_type\n    raise NotImplementedError\nNotImplementedError: \n```\n\n**To Reproduce**\n\n```python\nfrom typing import Hashable, cast\n\ntype Key[K: Hashable] = K | type[K]\ntype TP[K: Hashable] = tuple[Key[K], ...]\ntype Value[V] = V | type[V] | None\ntype T[K: Hashable, V] = tuple[*TP[K], Value[V]]\n\ndef f[K, V](one: TP[K] | T[K, V], other: TP[K] | T[K, V]) -> TP[K] | T[K, V] | None:\n    if len(one) \u003c len(other):\n        return None\n    if one[:len(other)] != other:\n        return None\n    return cast(TP[K] | T[K, V], one[len(other):])\n\ndef g[K, V](one: TP[K] | T[K, V], other: TP[K] | T[K, V]) -> int | None:\n    d: TP[K] | T[K, V] | None = f(one, other)\n    if d is None:\n        return None\n    n: int = len(d)\n    return n\n```\n\nand then run `mypy` on it.\n\n**Your Environment**\n\n\u003c!-- Include as many relevant details about the environment you experienced the bug in -->\n\n- Mypy version used: mypy 1.20.0+dev.56c33f251cb6b3791297fdaa57453d4afaa8c4dc (compiled: no)\n- Mypy command-line flags: `--show-traceback`\n- Mypy configuration options from `mypy.ini` (and other config files):\n- Python version used: Python 3.13.5\n- Operating system and version: 6.12.57+deb13-amd64 `#1` SMP PREEMPT_DYNAMIC Debian 6.12.57-1 (2025-11-05) x86_64 GNU/Linux\n\n\u003c!--\nYou can freely edit this text, please remove all the lines\nyou believe are unnecessary.\n-->\n","author":{"url":"https://github.com/guillonb","@type":"Person","name":"guillonb"},"datePublished":"2026-01-05T20:13:22Z","url":"https://github.com/python/mypy/issues/20526"}

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:b4fdf614-5e2d-dae5-6330-0d304fe4efff
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDA50:3E7030:2A1D02:38C35C:6B0025B7
html-safe-noncedc5b7bcaf7af1c96f039001f982b8797d48ca8b74c45ab4a5cbdaec0fcbc56c5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTUwOjNFNzAzMDoyQTFEMDI6MzhDMzVDOjZCMDAyNUI3IiwidmlzaXRvcl9pZCI6IjkwNDE2ODAxNzIwODgxMjk4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacda9a2a0bbf1dae67e3b13b697e79ed80b2f75334eb6605feaca249ca105cdd40
hovercard-subject-tagissue:3782737732
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/20526/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1971281a5e3eab3b480ee0b5151385051493c8628ab8bedb0206cf75a0072a9a/python/mypy/issues/20526
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1971281a5e3eab3b480ee0b5151385051493c8628ab8bedb0206cf75a0072a9a/python/mypy/issues/20526
og:image:altCrash Report INTERNAL ERROR Traceback mwe-mypy2.py:19: error: INTERNAL ERROR -- Please try using mypy master on GitHub: https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameguillonb
hostnamegithub.com
expected-hostnamegithub.com
None4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0
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
release44c658b24abf00491fb7ae5f56d42c9f38cbeab2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/20526#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F20526
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%2F20526
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/20526
Reloadhttps://github.com/python/mypy/issues/20526
Reloadhttps://github.com/python/mypy/issues/20526
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/20526
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/20526
#21558https://github.com/python/mypy/pull/21558
Crash on code mixing instances and type typed variableshttps://github.com/python/mypy/issues/20526#top
#21558https://github.com/python/mypy/pull/21558
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/guillonb
guillonbhttps://github.com/guillonb
on Jan 5, 2026https://github.com/python/mypy/issues/20526#issue-3782737732
guillonbhttps://github.com/guillonb
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
on Jan 5, 2026https://github.com/python/mypy/issues/20526#event-21862078075
https://github.com/A5rocks
A5rockshttps://github.com/A5rocks
on Jan 5, 2026https://github.com/python/mypy/issues/20526#issuecomment-3711965249
A5rockshttps://github.com/A5rocks
topic-pep-646PEP 646 (TypeVarTuple, Unpack)https://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-pep-646%22
on Jan 5, 2026https://github.com/python/mypy/issues/20526#event-21862227052
https://github.com/A5rocks
A5rockshttps://github.com/A5rocks
on Jan 5, 2026https://github.com/python/mypy/issues/20526#issuecomment-3711977791
ilevkivskyihttps://github.com/ilevkivskyi
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#21558https://github.com/python/mypy/pull/21558
on May 29, 2026https://github.com/python/mypy/issues/20526#event-26088419540
ilevkivskyihttps://github.com/ilevkivskyi
on May 29, 2026https://github.com/python/mypy/issues/20526#event-26088419606
Fix crash on unhandled meet variadic tuple vs indtance (#21558)https://github.com/python/mypy/commit/c2fd9d333127b3f39cdb9ef53288b97bb24d58c4
#21558https://github.com/python/mypy/pull/21558
c2fd9d3https://github.com/python/mypy/commit/c2fd9d333127b3f39cdb9ef53288b97bb24d58c4
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/20526
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/20526
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.