René's URL Explorer Experiment


Title: Internal error with an alias type that is a callable with an unpacked tuple as args · Issue #16533 · python/mypy · GitHub

Open Graph Title: Internal error with an alias type that is a callable with an unpacked tuple as args · Issue #16533 · python/mypy

X Title: Internal error with an alias type that is a callable with an unpacked tuple as args · Issue #16533 · python/mypy

Description: Bug Report Mypy crashes (errors) when using an aliased Callable with an unpacked Tuple within the arguments part. The definition throws no errors and using the type without the use of an alias is also working fine. mypy version: 1.7.0 py...

Open Graph Description: Bug Report Mypy crashes (errors) when using an aliased Callable with an unpacked Tuple within the arguments part. The definition throws no errors and using the type without the use of an alias is a...

X Description: Bug Report Mypy crashes (errors) when using an aliased Callable with an unpacked Tuple within the arguments part. The definition throws no errors and using the type without the use of an alias is a...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Internal error with an alias type that is a callable with an unpacked tuple as args","articleBody":"**Bug Report**\r\n\r\nMypy crashes (errors) when using an aliased `Callable` with an unpacked `Tuple` within the arguments part. The definition throws no errors and using the type without the use of an alias is also working fine.\r\n\r\nmypy version: 1.7.0\r\npython version: 3.11.2\r\n\r\n**To Reproduce**\r\n\r\nThis is the smallest reproduction I could come up with. The error occours with the definition of `f2` where the type alias `_CallableValue` is used.\r\n\r\n```python\r\nfrom typing import Callable, Any, Tuple, Unpack\r\n\r\n\r\n_CallableValue = Callable[[Unpack[Tuple[Any, ...]]], Any]  # This is fine\r\n\r\ndef f(fun: Callable[[Unpack[Tuple[Any, ...]]], Any]) -> None: ...  # This is fine\r\n\r\ndef f2(fun: _CallableValue) -> None: ...  # Mypy errors here with an internal error\r\n\r\n```\r\n([Playground](https://mypy-play.net/?mypy=1.7.0&python=3.11&flags=show-traceback&gist=9adb1b244c3693114130f82525cf42c8))\r\n\r\n**Expected Behavior**\r\n\r\nI would expect mypy to not have an internal error and instead produce a success result.\r\n\r\n**Actual Behavior**\r\n\r\nMypy has an internal error.\r\n\r\nOutput with my projects environment (VSCode, Python 3.11.2, mypy 1.7.0 (compiled: yes)):\r\n\r\n```Stacktrace\r\n2023-11-21 12:20:06.389 [info] [Trace - 12:20:06 PM] Sending notification 'textDocument/didSave'.\r\n2023-11-21 12:20:06.397 [info] [Trace - 12:20:06 PM] Received notification 'window/logMessage'.\r\n2023-11-21 12:20:06.397 [info] venv/Scripts/python.exe -m mypy --no-color-output --no-error-summary --show-absolute-path --show-column-numbers --show-error-codes --no-pretty --show-traceback --show-error-end c:\\Users\\[PROJECT_PATH]\\.vscode\\mypytest.py\r\n2023-11-21 12:20:06.398 [info] [Trace - 12:20:06 PM] Received notification 'window/logMessage'.\r\n2023-11-21 12:20:06.398 [info] CWD Server: c:\\Users\\[PROJECT_PATH]\r\n2023-11-21 12:20:07.125 [info] [Trace - 12:20:07 PM] Received notification 'window/logMessage'.\r\n2023-11-21 12:20:07.125 [info] c:\\Users\\[PROJECT_PATH]\\.vscode\\mypytest.py:7: error: INTERNAL ERROR -- Please try using mypy master on GitHub:\r\nhttps://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build\r\nPlease report a bug at https://github.com/python/mypy/issues\r\nversion: 1.7.0\r\nc:\\Users\\[PROJECT_PATH]\\.vscode\\mypytest.py:7: : note: use --pdb to drop into pdb\r\n\r\n2023-11-21 12:20:07.126 [info] [Trace - 12:20:07 PM] Received notification 'window/logMessage'.\r\n2023-11-21 12:20:07.126 [info] file:///c%3A/Users/[PROJECT_PATH]/.vscode/mypytest.py :\r\nTraceback (most recent call last):\r\n  File \"\u003cfrozen runpy>\", line 198, in _run_module_as_main\r\n  File \"\u003cfrozen runpy>\", line 88, in _run_code\r\n  File \"mypy\\semanal.py\", line 6525, in accept\r\n  File \"mypy\\nodes.py\", line 785, in accept\r\n  File \"mypy\\semanal.py\", line 832, in visit_func_def\r\n  File \"mypy\\semanal.py\", line 866, in analyze_func_def\r\n  File \"mypy\\semanal_shared.py\", line 373, in has_placeholder\r\n  File \"mypy\\types.py\", line 1964, in accept\r\n  File \"mypy\\type_visitor.py\", line 505, in visit_callable_type\r\n  File \"mypy\\type_visitor.py\", line 557, in query_types\r\n  File \"mypy\\types.py\", line 395, in accept\r\n  File \"mypy\\type_visitor.py\", line 550, in visit_type_alias_type\r\n  File \"mypy\\types.py\", line 3072, in get_proper_type\r\n  File \"mypy\\types.py\", line 337, in _expand_once\r\n  File \"mypy\\types.py\", line 1964, in accept\r\n  File \"mypy\\expandtype.py\", line 368, in visit_callable_type\r\n  File \"mypy\\expandtype.py\", line 317, in interpolate_args_for_unpack\r\nAssertionError: \r\n\r\n2023-11-21 12:20:07.126 [info] [Trace - 12:20:07 PM] Received notification 'window/logMessage'.\r\n2023-11-21 12:20:07.126 [info] file:///c%3A/Users/[PROJECT_PATH]/.vscode/mypytest.py :\r\nTraceback (most recent call last):\r\n  File \"\u003cfrozen runpy>\", line 198, in _run_module_as_main\r\n  File \"\u003cfrozen runpy>\", line 88, in _run_code\r\n  File \"mypy\\semanal.py\", line 6525, in accept\r\n  File \"mypy\\nodes.py\", line 785, in accept\r\n  File \"mypy\\semanal.py\", line 832, in visit_func_def\r\n  File \"mypy\\semanal.py\", line 866, in analyze_func_def\r\n  File \"mypy\\semanal_shared.py\", line 373, in has_placeholder\r\n  File \"mypy\\types.py\", line 1964, in accept\r\n  File \"mypy\\type_visitor.py\", line 505, in visit_callable_type\r\n  File \"mypy\\type_visitor.py\", line 557, in query_types\r\n  File \"mypy\\types.py\", line 395, in accept\r\n  File \"mypy\\type_visitor.py\", line 550, in visit_type_alias_type\r\n  File \"mypy\\types.py\", line 3072, in get_proper_type\r\n  File \"mypy\\types.py\", line 337, in _expand_once\r\n  File \"mypy\\types.py\", line 1964, in accept\r\n  File \"mypy\\expandtype.py\", line 368, in visit_callable_type\r\n  File \"mypy\\expandtype.py\", line 317, in interpolate_args_for_unpack\r\nAssertionError: \r\n\r\n2023-11-21 12:20:07.126 [info] [Trace - 12:20:07 PM] Received notification 'textDocument/publishDiagnostics'.\r\n```\r\n\r\nPlayground gist output (Python 3.11 and mypy 1.7.0)\r\n\r\n```stacktrace\r\nFailed (exit code: 2) (3302 ms)\r\n\r\nTraceback (most recent call last):\r\n  File \"\u003cfrozen runpy>\", line 198, in _run_module_as_main\r\n  File \"\u003cfrozen runpy>\", line 88, in _run_code\r\n  File \"mypy/semanal.py\", line 6525, in accept\r\n  File \"mypy/nodes.py\", line 785, in accept\r\n  File \"mypy/semanal.py\", line 832, in visit_func_def\r\n  File \"mypy/semanal.py\", line 866, in analyze_func_def\r\n  File \"mypy/semanal_shared.py\", line 373, in has_placeholder\r\n  File \"mypy/types.py\", line 1964, in accept\r\n  File \"mypy/type_visitor.py\", line 505, in visit_callable_type\r\n  File \"mypy/type_visitor.py\", line 557, in query_types\r\n  File \"mypy/types.py\", line 395, in accept\r\n  File \"mypy/type_visitor.py\", line 550, in visit_type_alias_type\r\n  File \"mypy/types.py\", line 3072, in get_proper_type\r\n  File \"mypy/types.py\", line 337, in _expand_once\r\n  File \"mypy/types.py\", line 1964, in accept\r\n  File \"mypy/expandtype.py\", line 368, in visit_callable_type\r\n  File \"mypy/expandtype.py\", line 317, in interpolate_args_for_unpack\r\nAssertionError: \r\n\r\nmain.py:8: error: INTERNAL ERROR -- Please try using mypy master on GitHub:\r\nhttps://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build\r\nPlease report a bug at https://github.com/python/mypy/issues\r\nversion: 1.7.0\r\nmain.py:8: : note: use --pdb to drop into pdb\r\n```\r\n\r\n**Your Environment**\r\n\r\n- Mypy version used: 1.7.0 (compiled: yes)\r\n- Mypy command-line flags: `-no-color-output --no-error-summary --show-absolute-path --show-column-numbers --show-error-codes --no-pretty --show-traceback --show-error-end c:\\Users\\[PROJECT_PATH]\\.vscode\\mypytest.py`\r\n- Mypy configuration options from `mypy.ini` (and other config files):\r\n```cfg\r\n[mypy]\r\nplugins = pydantic.mypy\r\nfollow_imports = silent\r\nwarn_redundant_casts = True\r\ndisallow_untyped_defs = True\r\ndisallow_any_unimported = False\r\nno_implicit_optional = True\r\ncheck_untyped_defs = True\r\nwarn_return_any = True\r\nshow_error_codes = True\r\nwarn_unused_ignores = True\r\n```\r\n- Python version used: 3.11.2\r\n\r\n(It's reproducable on the mypy playground, please see the \"Playground\"-link at the bottom of the \"To Reproduce\"-section.)\r\n\r\n","author":{"url":"https://github.com/Drache91","@type":"Person","name":"Drache91"},"datePublished":"2023-11-21T11:53:15Z","url":"https://github.com/python/mypy/issues/16533"}

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:8014aaf2-e4cb-663f-d82c-b10b7cfb7855
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBDAE:354B:53F6AD:6D63A8:6AFFC443
html-safe-nonce99f7d161d7715e1ce935edbfea53ca6418d83015ebf240ea3bb1793d239b2495
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCREFFOjM1NEI6NTNGNkFEOjZENjNBODo2QUZGQzQ0MyIsInZpc2l0b3JfaWQiOiIzODIzNDcyNjE3MDM4MjY3NDU5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac3068c6de93105520685c9c5ca4e545b30156e0ce711b884648db403ac833e53c
hovercard-subject-tagissue:2004110272
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/16533/issue_layout
twitter:imagehttps://opengraph.githubassets.com/bdd30083daa4b9664ee20784c85c78cd4359e67dfc1a22a31b770846b6abf799/python/mypy/issues/16533
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/bdd30083daa4b9664ee20784c85c78cd4359e67dfc1a22a31b770846b6abf799/python/mypy/issues/16533
og:image:altBug Report Mypy crashes (errors) when using an aliased Callable with an unpacked Tuple within the arguments part. The definition throws no errors and using the type without the use of an alias is a...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDrache91
hostnamegithub.com
expected-hostnamegithub.com
None1e805b832df235bb21305db712c3b6432920019dfc12cb25b9cb8d3b0c9403cf
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
release8fa4a54e6871c7908eda1c246ad5972982c0b59d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/16533#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F16533
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%2F16533
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/16533
Reloadhttps://github.com/python/mypy/issues/16533
Reloadhttps://github.com/python/mypy/issues/16533
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 requests547 (547)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/16533
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/16533
#16541https://github.com/python/mypy/pull/16541
Internal error with an alias type that is a callable with an unpacked tuple as argshttps://github.com/python/mypy/issues/16533#top
#16541https://github.com/python/mypy/pull/16541
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
topic-type-aliasTypeAlias and other type alias issueshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-type-alias%22
https://github.com/Drache91
Drache91https://github.com/Drache91
on Nov 21, 2023https://github.com/python/mypy/issues/16533#issue-2004110272
Playgroundhttps://mypy-play.net/?mypy=1.7.0&python=3.11&flags=show-traceback&gist=9adb1b244c3693114130f82525cf42c8
Drache91https://github.com/Drache91
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
on Nov 21, 2023https://github.com/python/mypy/issues/16533#event-11023369411
AlexWaygoodhttps://github.com/AlexWaygood
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
topic-type-aliasTypeAlias and other type alias issueshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-type-alias%22
bugmypy got something wronghttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22bug%22
on Nov 21, 2023https://github.com/python/mypy/issues/16533#event-11023388682
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Nov 22, 2023https://github.com/python/mypy/issues/16533#issuecomment-1822672712
JukkaLhttps://github.com/JukkaL
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#16541https://github.com/python/mypy/pull/16541
on Dec 12, 2023https://github.com/python/mypy/issues/16533#event-11227685758
JukkaLhttps://github.com/JukkaL
on Dec 12, 2023https://github.com/python/mypy/issues/16533#event-11227686136
Fix crash with type alias to `Callable[[Unpack[Tuple[Any, ...]]], Any…https://github.com/python/mypy/commit/5fa95693bb3ca312224a5194dbb5149f8e7d7a55
https://docs.github.com/articles/closing-issues-via-commit-messages
5fa9569https://github.com/python/mypy/commit/5fa95693bb3ca312224a5194dbb5149f8e7d7a55
wesleywrighthttps://github.com/wesleywright
on Dec 12, 2023https://github.com/python/mypy/issues/16533#event-11227703837
Fix crash with type alias to `Callable[[Unpack[Tuple[Any, ...]]], Any…https://github.com/python/mypy/commit/60d30e36c49a2753de2d71f7dd50f5143bafd307
https://docs.github.com/articles/closing-issues-via-commit-messages
60d30e3https://github.com/python/mypy/commit/60d30e36c49a2753de2d71f7dd50f5143bafd307
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/16533
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/16533
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
topic-type-aliasTypeAlias and other type alias issueshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-type-alias%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.