René's URL Explorer Experiment


Title: Master (0.530-dev) crash on tuple unpacking · Issue #4046 · python/mypy · GitHub

Open Graph Title: Master (0.530-dev) crash on tuple unpacking · Issue #4046 · python/mypy

X Title: Master (0.530-dev) crash on tuple unpacking · Issue #4046 · python/mypy

Description: Repro: from typing import Tuple, TypeVar _T1 = TypeVar('_T1') def make_tuple(elem: _T1) -> Tuple[_T1]: return (elem,) def main() -> None: ((a, b),) = make_tuple((1, 2)) produces: Traceback (most recent call last): File "/Users/ambv/.venv...

Open Graph Description: Repro: from typing import Tuple, TypeVar _T1 = TypeVar('_T1') def make_tuple(elem: _T1) -> Tuple[_T1]: return (elem,) def main() -> None: ((a, b),) = make_tuple((1, 2)) produces: Traceback (most re...

X Description: Repro: from typing import Tuple, TypeVar _T1 = TypeVar('_T1') def make_tuple(elem: _T1) -> Tuple[_T1]: return (elem,) def main() -> None: ((a, b),) = make_tuple((1, 2)) produces: Trac...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Master (0.530-dev) crash on tuple unpacking","articleBody":"Repro:\r\n```py3\r\nfrom typing import Tuple, TypeVar\r\n\r\n_T1 = TypeVar('_T1')\r\n\r\ndef make_tuple(elem: _T1) -> Tuple[_T1]:\r\n    return (elem,)\r\n\r\ndef main() -> None:\r\n    ((a, b),) = make_tuple((1, 2))\r\n```\r\n\r\nproduces:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/Users/ambv/.venvs/mypy/bin/mypy\", line 11, in \u003cmodule>\r\n    load_entry_point('mypy', 'console_scripts', 'mypy')()\r\n  File \"mypy/__main__.py\", line 7, in console_entry\r\n    main(None)\r\n  File \"mypy/main.py\", line 50, in main\r\n    res = type_check_only(sources, bin_dir, options)\r\n  File \"mypy/main.py\", line 103, in type_check_only\r\n    options=options)\r\n  File \"mypy/build.py\", line 198, in build\r\n    graph = dispatch(sources, manager)\r\n  File \"mypy/build.py\", line 1841, in dispatch\r\n    process_graph(graph, manager)\r\n  File \"mypy/build.py\", line 2091, in process_graph\r\n    process_stale_scc(graph, scc, manager)\r\n  File \"mypy/build.py\", line 2194, in process_stale_scc\r\n    graph[id].type_check_first_pass()\r\n  File \"mypy/build.py\", line 1753, in type_check_first_pass\r\n    self.type_checker.check_first_pass()\r\n  File \"mypy/checker.py\", line 194, in check_first_pass\r\n    self.accept(d)\r\n  File \"mypy/checker.py\", line 282, in accept\r\n    stmt.accept(self)\r\n  File \"mypy/nodes.py\", line 519, in accept\r\n    return visitor.visit_func_def(self)\r\n  File \"mypy/checker.py\", line 530, in visit_func_def\r\n    self.check_func_item(defn, name=defn.name())\r\n  File \"mypy/checker.py\", line 590, in check_func_item\r\n    self.check_func_def(defn, typ, name)\r\n  File \"mypy/checker.py\", line 750, in check_func_def\r\n    self.accept(item.body)\r\n  File \"mypy/checker.py\", line 282, in accept\r\n    stmt.accept(self)\r\n  File \"mypy/nodes.py\", line 773, in accept\r\n    return visitor.visit_block(self)\r\n  File \"mypy/checker.py\", line 1304, in visit_block\r\n    self.accept(s)\r\n  File \"mypy/checker.py\", line 282, in accept\r\n    stmt.accept(self)\r\n  File \"mypy/nodes.py\", line 817, in accept\r\n    return visitor.visit_assignment_stmt(self)\r\n  File \"mypy/checker.py\", line 1311, in visit_assignment_stmt\r\n    self.check_assignment(s.lvalues[-1], s.rvalue, s.type is None, s.new_syntax)\r\n  File \"mypy/checker.py\", line 1339, in check_assignment\r\n    infer_lvalue_type)\r\n  File \"mypy/checker.py\", line 1589, in check_assignment_to_multiple_lvalues\r\n    self.check_multi_assignment(lvalues, rvalue, context, infer_lvalue_type)\r\n  File \"mypy/checker.py\", line 1630, in check_multi_assignment\r\n    context, undefined_rvalue, infer_lvalue_type)\r\n  File \"mypy/checker.py\", line 1650, in check_multi_assignment_from_tuple\r\n    reinferred_rvalue_type = self.expr_checker.accept(rvalue, lvalue_type)\r\n  File \"mypy/checkexpr.py\", line 2372, in accept\r\n    typ = node.accept(self)\r\n  File \"mypy/nodes.py\", line 1256, in accept\r\n    return visitor.visit_call_expr(self)\r\n  File \"mypy/checkexpr.py\", line 266, in visit_call_expr\r\n    ret_type = self.check_call_expr_with_callee_type(callee_type, e, fullname, object_type)\r\n  File \"mypy/checkexpr.py\", line 503, in check_call_expr_with_callee_type\r\n    object_type=object_type)[0]\r\n  File \"mypy/checkexpr.py\", line 563, in check_call\r\n    callee, context)\r\n  File \"mypy/checkexpr.py\", line 752, in infer_function_type_arguments_using_context\r\n    erased_ctx = replace_meta_vars(ctx, ErasedType())\r\n  File \"mypy/erasetype.py\", line 94, in replace_meta_vars\r\n    return t.accept(TypeVarEraser(lambda id: id.is_meta_var(), target_type))\r\n  File \"mypy/types.py\", line 982, in accept\r\n    return visitor.visit_tuple_type(self)\r\n  File \"mypy/types.py\", line 1554, in visit_tuple_type\r\n    return TupleType(self.translate_types(t.items),\r\n  File \"mypy/types.py\", line 1574, in translate_types\r\n    return [t.accept(self) for t in types]\r\n  File \"mypy/types.py\", line 1574, in \u003clistcomp>\r\n    return [t.accept(self) for t in types]\r\n  File \"mypy/types.py\", line 982, in accept\r\n    return visitor.visit_tuple_type(self)\r\n  File \"mypy/types.py\", line 1554, in visit_tuple_type\r\n    return TupleType(self.translate_types(t.items),\r\n  File \"mypy/types.py\", line 1574, in translate_types\r\n    return [t.accept(self) for t in types]\r\n  File \"mypy/types.py\", line 1574, in \u003clistcomp>\r\n    return [t.accept(self) for t in types]\r\nAttributeError: 'NoneType' object has no attribute 'accept'\r\n/tmp/test.py:13: : note: use --pdb to drop into pdb\r\n```","author":{"url":"https://github.com/ambv","@type":"Person","name":"ambv"},"datePublished":"2017-10-02T23:31:08Z","url":"https://github.com/python/mypy/issues/4046"}

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:ec9a92aa-d96c-d993-4dbf-e3634928d261
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBE94:356FBF:1D6541B:2790D53:6B00085C
html-safe-noncea219692e3efabfbdc6401f72580121bc021396cf15fee3a066d9c48a3bcb2023
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTk0OjM1NkZCRjoxRDY1NDFCOjI3OTBENTM6NkIwMDA4NUMiLCJ2aXNpdG9yX2lkIjoiMTkxNTAwOTA0MDEzNjUzODIwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac345662e06cc417cd642c10c5de53bdd524b7a866a1ac03f45650e71958a50847
hovercard-subject-tagissue:262260477
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/4046/issue_layout
twitter:imagehttps://opengraph.githubassets.com/70b81909f22bf825947d18756252822114e3235b98556634e07cd552be9a80f3/python/mypy/issues/4046
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/70b81909f22bf825947d18756252822114e3235b98556634e07cd552be9a80f3/python/mypy/issues/4046
og:image:altRepro: from typing import Tuple, TypeVar _T1 = TypeVar('_T1') def make_tuple(elem: _T1) -> Tuple[_T1]: return (elem,) def main() -> None: ((a, b),) = make_tuple((1, 2)) produces: Traceback (most re...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameambv
hostnamegithub.com
expected-hostnamegithub.com
None0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729
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
release16a11879678aaf97e2a42c33ee70830aa084fa37
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/mypy/issues/4046#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F4046
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%2F4046
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/4046
Reloadhttps://github.com/python/mypy/issues/4046
Reloadhttps://github.com/python/mypy/issues/4046
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/4046
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/4046
Master (0.530-dev) crash on tuple unpackinghttps://github.com/python/mypy/issues/4046#top
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
priority-0-highhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-0-high%22
https://github.com/ambv
ambvhttps://github.com/ambv
on Oct 2, 2017https://github.com/python/mypy/issues/4046#issue-262260477
https://github.com/carljm
carljmhttps://github.com/carljm
on Oct 2, 2017https://github.com/python/mypy/issues/4046#issuecomment-333694896
eec6745https://github.com/python/mypy/commit/eec6745843169620f5dfbb6c2d65bf3cddedf6e6
https://github.com/emmatyping
emmatypinghttps://github.com/emmatyping
on Oct 2, 2017https://github.com/python/mypy/issues/4046#issuecomment-333697472
emmatypinghttps://github.com/emmatyping
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
priority-0-highhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-0-high%22
on Oct 2, 2017https://github.com/python/mypy/issues/4046#event-1275066400
ambvhttps://github.com/ambv
on Oct 3, 2017https://github.com/python/mypy/issues/4046#event-1275077191
https://github.com/ambv
ambvhttps://github.com/ambv
on Oct 3, 2017https://github.com/python/mypy/issues/4046#issuecomment-333699728
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Oct 3, 2017https://github.com/python/mypy/issues/4046#issuecomment-333702150
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Oct 3, 2017https://github.com/python/mypy/issues/4046#issuecomment-333704928
https://github.com/carljm
carljmhttps://github.com/carljm
on Oct 3, 2017https://github.com/python/mypy/issues/4046#issuecomment-333705405
@ambvhttps://github.com/ambv
https://github.com/carljm
carljmhttps://github.com/carljm
on Oct 3, 2017https://github.com/python/mypy/issues/4046#issuecomment-333706619
#3967https://github.com/python/mypy/pull/3967
https://github.com/carljm
carljmhttps://github.com/carljm
on Oct 3, 2017https://github.com/python/mypy/issues/4046#issuecomment-333707659
python/typeshed#1550https://github.com/python/typeshed/pull/1550
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Oct 3, 2017https://github.com/python/mypy/issues/4046#issuecomment-333728190
@JukkaLhttps://github.com/JukkaL
@ilevkivskyihttps://github.com/ilevkivskyi
https://github.com/emmatyping
emmatypinghttps://github.com/emmatyping
on Oct 3, 2017https://github.com/python/mypy/issues/4046#issuecomment-333771883
herehttps://github.com/python/mypy/blob/master/mypy/checker.py#L1686
check recursivelyhttps://github.com/python/mypy/blob/master/mypy/checker.py#L1771
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Oct 3, 2017https://github.com/python/mypy/issues/4046#issuecomment-333772855
#3966https://github.com/python/mypy/issues/3966
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Oct 3, 2017https://github.com/python/mypy/issues/4046#issuecomment-333774325
gvanrossumhttps://github.com/gvanrossum
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#4051https://github.com/python/mypy/pull/4051
on Oct 3, 2017https://github.com/python/mypy/issues/4046#event-1276865508
gvanrossumhttps://github.com/gvanrossum
on Oct 3, 2017https://github.com/python/mypy/issues/4046#event-1276865630
Never put None in TupleType items (#4051)https://github.com/python/mypy/commit/d23fc47d35ce0fdad8f34832ec7348395252df8f
#4051https://github.com/python/mypy/pull/4051
https://docs.github.com/articles/closing-issues-via-commit-messages
d23fc47https://github.com/python/mypy/commit/d23fc47d35ce0fdad8f34832ec7348395252df8f
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Oct 3, 2017https://github.com/python/mypy/issues/4046#issuecomment-333983601
@ambvhttps://github.com/ambv
@carljmhttps://github.com/carljm
https://github.com/carljm
carljmhttps://github.com/carljm
on Oct 3, 2017https://github.com/python/mypy/issues/4046#issuecomment-333996504
@gvanrossumhttps://github.com/gvanrossum
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/4046
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/4046
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
priority-0-highhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22priority-0-high%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.