René's URL Explorer Experiment


Title: Crash in lambda expression as generic argument · Issue #8230 · python/mypy · GitHub

Open Graph Title: Crash in lambda expression as generic argument · Issue #8230 · python/mypy

X Title: Crash in lambda expression as generic argument · Issue #8230 · python/mypy

Description: This test crashes on current master (and causes troubles internally): [case testFilterIn] from typing import List, TypeVar, Callable T = TypeVar('T') def filter(f: Callable[[T], bool], it: List[T]) -> List[T]: ... xs: List[int] filter(la...

Open Graph Description: This test crashes on current master (and causes troubles internally): [case testFilterIn] from typing import List, TypeVar, Callable T = TypeVar('T') def filter(f: Callable[[T], bool], it: List[T])...

X Description: This test crashes on current master (and causes troubles internally): [case testFilterIn] from typing import List, TypeVar, Callable T = TypeVar('T') def filter(f: Callable[[T], bool], it: ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash in lambda expression as generic argument","articleBody":"This test crashes on current master (and causes troubles internally):\r\n```\r\n[case testFilterIn]\r\nfrom typing import List, TypeVar, Callable\r\n\r\nT = TypeVar('T')\r\ndef filter(f: Callable[[T], bool], it: List[T]) -> List[T]: ...\r\n\r\nxs: List[int]\r\nfilter(lambda x: x in [1, 2] and bool(), [3, 4])\r\n[builtins fixtures/list.pyi]\r\n```\r\nwith a traceback that ends in\r\n```\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checkexpr.py\", line 942, in check_callable_call\r\n    callee, args, arg_kinds, formal_to_actual, context)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checkexpr.py\", line 1145, in infer_function_type_arguments\r\n    callee_type, args, arg_kinds, formal_to_actual)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checkexpr.py\", line 1043, in infer_arg_types_in_context\r\n    res[ai] = self.accept(args[ai], callee.arg_types[i])\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checkexpr.py\", line 3723, in accept\r\n    typ = node.accept(self)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/nodes.py\", line 1852, in accept\r\n    return visitor.visit_lambda_expr(self)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checkexpr.py\", line 3334, in visit_lambda_expr\r\n    self.chk.check_func_item(e, type_override=type_override)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checker.py\", line 790, in check_func_item\r\n    self.check_func_def(defn, typ, name)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checker.py\", line 973, in check_func_def\r\n    self.accept(item.body)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checker.py\", line 399, in accept\r\n    stmt.accept(self)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/nodes.py\", line 1004, in accept\r\n    return visitor.visit_block(self)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checker.py\", line 1970, in visit_block\r\n    self.accept(s)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checker.py\", line 399, in accept\r\n    stmt.accept(self)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/nodes.py\", line 1140, in accept\r\n    return visitor.visit_return_stmt(self)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checker.py\", line 3090, in visit_return_stmt\r\n    self.check_return_stmt(s)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checker.py\", line 3123, in check_return_stmt\r\n    s.expr, return_type, allow_none_return=allow_none_func_call))\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checkexpr.py\", line 3723, in accept\r\n    typ = node.accept(self)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/nodes.py\", line 1736, in accept\r\n    return visitor.visit_op_expr(self)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checkexpr.py\", line 2077, in visit_op_expr\r\n    return self.check_boolean_op(e, e)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checkexpr.py\", line 2703, in check_boolean_op\r\n    right_map, left_map = self.chk.find_isinstance_check(e.left)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checker.py\", line 3811, in find_isinstance_check\r\n    if_map, else_map = self.find_isinstance_check_helper(node)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/checker.py\", line 3926, in find_isinstance_check_helper\r\n    if is_overlapping_erased_types(item_type, collection_item_type):\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/meet.py\", line 361, in is_overlapping_erased_types\r\n    return is_overlapping_types(erase_type(left), erase_type(right),\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/erasetype.py\", line 25, in erase_type\r\n    return typ.accept(EraseTypeVisitor())\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/types.py\", line 694, in accept\r\n    return visitor.visit_erased_type(self)\r\n  File \"/Users/ilevkivskyi/src/mypy/mypy/erasetype.py\", line 45, in visit_erased_type\r\n    raise RuntimeError()\r\nRuntimeError: \r\n```\r\nThis may be related to https://github.com/python/mypy/pull/8148, also note there is a weird `pass` [here](https://github.com/python/mypy/blob/master/mypy/checker.py#L3918) (it should probably be `continue`).\r\n\r\ncc @Michael0x2a ","author":{"url":"https://github.com/ilevkivskyi","@type":"Person","name":"ilevkivskyi"},"datePublished":"2020-01-02T19:53:56Z","url":"https://github.com/python/mypy/issues/8230"}

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:06f74062-ed4e-f3ba-42db-c0c469695344
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAC4C:115983:A87998:E16175:6B004789
html-safe-nonce4ac2b1a081fd1e810b50de789d4dd605e05fd7d5ac757cf595e36bcd68753584
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzRDOjExNTk4MzpBODc5OTg6RTE2MTc1OjZCMDA0Nzg5IiwidmlzaXRvcl9pZCI6IjE1MzUwOTkxMjEwMTMxMTQ3NjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf799c3f2f24592b0156c215d3d8063e678abcae1444935e9cc8676cc6a03c4a0
hovercard-subject-tagissue:544721676
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/8230/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b1373ec42c8af8b98644f2e1fa9016d6a821254e6e155080ba25b8e2dba978dd/python/mypy/issues/8230
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b1373ec42c8af8b98644f2e1fa9016d6a821254e6e155080ba25b8e2dba978dd/python/mypy/issues/8230
og:image:altThis test crashes on current master (and causes troubles internally): [case testFilterIn] from typing import List, TypeVar, Callable T = TypeVar('T') def filter(f: Callable[[T], bool], it: List[T])...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameilevkivskyi
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/8230#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F8230
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%2F8230
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/8230
Reloadhttps://github.com/python/mypy/issues/8230
Reloadhttps://github.com/python/mypy/issues/8230
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 requests545 (545)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/8230
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/8230
Crash in lambda expression as generic argumenthttps://github.com/python/mypy/issues/8230#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
topic-type-variableshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-type-variables%22
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jan 2, 2020https://github.com/python/mypy/issues/8230#issue-544721676
#8148https://github.com/python/mypy/pull/8148
herehttps://github.com/python/mypy/blob/master/mypy/checker.py#L3918
@Michael0x2ahttps://github.com/Michael0x2a
ilevkivskyihttps://github.com/ilevkivskyi
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 Jan 2, 2020https://github.com/python/mypy/issues/8230#event-2918628543
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
on Jan 2, 2020https://github.com/python/mypy/issues/8230#issuecomment-570324468
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jan 2, 2020https://github.com/python/mypy/issues/8230#issuecomment-570328942
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
on Jan 2, 2020https://github.com/python/mypy/issues/8230#issuecomment-570329968
Michael0x2ahttps://github.com/Michael0x2a
on Jan 2, 2020https://github.com/python/mypy/issues/8230#event-2919011672
Fix regression in container check logichttps://github.com/Michael0x2a/mypy/commit/3c5d0f029c108df2dd9181925c5bb11247171f78
3c5d0f0https://github.com/Michael0x2a/mypy/commit/3c5d0f029c108df2dd9181925c5bb11247171f78
Fix regression in container check logichttps://github.com/Michael0x2a/mypy/commit/a1136d93d89c54966bf60ec8c9ba0d2c2249d08d
a1136d9https://github.com/Michael0x2a/mypy/commit/a1136d93d89c54966bf60ec8c9ba0d2c2249d08d
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
on Jan 2, 2020https://github.com/python/mypy/issues/8230#issuecomment-570399979
infer_function_type_argumentshttps://github.com/python/mypy/blob/master/mypy/checkexpr.py#L1126
visit_lambda_exprhttps://github.com/python/mypy/blob/master/mypy/checkexpr.py#L3313
https://github.com/python/mypy/blob/master/mypy/checkexpr.py#L3372https://github.com/python/mypy/blob/master/mypy/checkexpr.py#L3372
#5738https://github.com/python/mypy/issues/5738
ilevkivskyihttps://github.com/ilevkivskyi
on Jan 3, 2020https://github.com/python/mypy/issues/8230#event-2920357020
Fix regression in container check logic (#8232)https://github.com/python/mypy/commit/cdd91ba819646b0138b05a8e9180faba4ef0ff92
#8232https://github.com/python/mypy/pull/8232
cdd91bahttps://github.com/python/mypy/commit/cdd91ba819646b0138b05a8e9180faba4ef0ff92
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Jan 3, 2020https://github.com/python/mypy/issues/8230#issuecomment-570590505
#5738https://github.com/python/mypy/issues/5738
ilevkivskyihttps://github.com/ilevkivskyi
on Jan 3, 2020https://github.com/python/mypy/issues/8230#event-2920361188
ilevkivskyihttps://github.com/ilevkivskyi
topic-type-variableshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-type-variables%22
on Jan 3, 2020https://github.com/python/mypy/issues/8230#event-2920361471
https://github.com/AlexWaygood
AlexWaygoodhttps://github.com/AlexWaygood
on Jun 18, 2022https://github.com/python/mypy/issues/8230#issuecomment-1159432337
#8232https://github.com/python/mypy/pull/8232
@Michael0x2ahttps://github.com/Michael0x2a
#8230 (comment)https://github.com/python/mypy/issues/8230#issuecomment-570329968
crashed on mypy <=0.930https://mypy-play.net/?mypy=0.930&python=3.10&flags=show-traceback&gist=c2b1a5d8f16c9b5681a737f10c05dd47
doesn't crash on 0.931+https://mypy-play.net/?mypy=0.931&python=3.10&flags=show-traceback&gist=cf9a4e324e5fee6220e208da426c5656
a0f27b1https://github.com/python/mypy/commit/a0f27b1d1f21bc6c7502374c3a1e2b642758a4bb
@sobolevnhttps://github.com/sobolevn
#11924https://github.com/python/mypy/pull/11924
@JelleZijlstrahttps://github.com/JelleZijlstra
@JukkaLhttps://github.com/JukkaL
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Jun 18, 2022https://github.com/python/mypy/issues/8230#issuecomment-1159464118
AlexWaygoodhttps://github.com/AlexWaygood
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 18, 2022https://github.com/python/mypy/issues/8230#event-6833081319
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/8230
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/8230
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
topic-type-variableshttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-type-variables%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.