René's URL Explorer Experiment


Title: "AssertionError: Cannot find component" for local NamedTuple · Issue #7281 · python/mypy · GitHub

Open Graph Title: "AssertionError: Cannot find component" for local NamedTuple · Issue #7281 · python/mypy

X Title: "AssertionError: Cannot find component" for local NamedTuple · Issue #7281 · python/mypy

Description: I've got an obscure bug which I narrowed down to some cache issues when you have a local class inheriting from NamedTuple. Stacktrace: Traceback (most recent call last): File "/home/karlicos/.local/bin/mypy", line 10, in sys.exi...

Open Graph Description: I've got an obscure bug which I narrowed down to some cache issues when you have a local class inheriting from NamedTuple. Stacktrace: Traceback (most recent call last): File "/home/karlicos/.local...

X Description: I've got an obscure bug which I narrowed down to some cache issues when you have a local class inheriting from NamedTuple. Stacktrace: Traceback (most recent call last): File "/home/karlic...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"AssertionError: Cannot find component\" for local NamedTuple","articleBody":"I've got an obscure bug which I narrowed down to some cache issues when you have a local class inheriting from `NamedTuple`. \r\n\r\nStacktrace:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/home/karlicos/.local/bin/mypy\", line 10, in \u003cmodule>\r\n    sys.exit(console_entry())\r\n  File \"/home/karlicos/.local/lib/python3.7/site-packages/mypy/__main__.py\", line 8, in console_entry\r\n    main(None, sys.stdout, sys.stderr)\r\n  File \"mypy/main.py\", line 83, in main\r\n  File \"mypy/build.py\", line 164, in build\r\n  File \"mypy/build.py\", line 224, in _build\r\n  File \"mypy/build.py\", line 2579, in dispatch\r\n  File \"mypy/build.py\", line 2885, in process_graph\r\n  File \"mypy/build.py\", line 2963, in process_fresh_modules\r\n  File \"mypy/build.py\", line 1876, in fix_cross_refs\r\n  File \"mypy/fixup.py\", line 25, in fixup_module\r\n  File \"mypy/fixup.py\", line 76, in visit_symbol_table\r\n  File \"mypy/fixup.py\", line 265, in lookup_qualified_stnode\r\n  File \"mypy/lookup.py\", line 47, in lookup_fully_qualified\r\nAssertionError: Cannot find component 'NT@3' for 'breaking.NT@3\r\n```\r\n\r\nEasiest to reproduce with the following script (it's crashing on the last mypy invocation)\r\n\r\n```\r\n#!/bin/bash -eux\r\ncd \"$(dirname \"$0\")\"\r\n\r\nrm -rf .mypy_cache\r\n\r\necho 'from typing import NamedTuple' > breaking.py\r\necho 'def test():'                  >> breaking.py\r\necho '  class NT(NamedTuple):'      >> breaking.py\r\necho '    pass'                     >> breaking.py\r\n\r\necho 'import breaking' > script.py\r\nmypy script.py\r\n\r\necho '' > script.py\r\nmypy script.py\r\n\r\necho 'import breaking' > script.py\r\nmypy script.py\r\n```\r\n\r\nMost similar issue to this one I found seems to be https://github.com/python/mypy/issues/2931, but using singleline `NamedTuple` definition (e.g.  `NT = NamedTuple('NT', [])`) doesn't result in failure, so I figured this is worth separate issue.\r\nUsing `@dataclass` doesn't result in failure either.\r\n\r\nI'm using mypy `0.720`. (upd: still happens on `0.800`)\r\n","author":{"url":"https://github.com/karlicoss","@type":"Person","name":"karlicoss"},"datePublished":"2019-08-02T15:34:41Z","url":"https://github.com/python/mypy/issues/7281"}

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:3e55ce6b-fb75-09c6-96df-8dc6acfd9382
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB266:142FA7:44B662:5C7E3D:6B002C52
html-safe-nonce3075db054fb6b8330ff01d293bf19450f21dbc74727134baa721de880c0a736f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjY2OjE0MkZBNzo0NEI2NjI6NUM3RTNEOjZCMDAyQzUyIiwidmlzaXRvcl9pZCI6IjEyNDI1NDk1NzExMjk3MTU3OTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3864054689ab9278a9d6647fa24d060d81c2277762a8d563f5d9fe72c8a384fb
hovercard-subject-tagissue:476239511
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/7281/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5967f261ae157c1997f31e290d6e46b4f3b5085aebe19f6e8d603b408078ffd7/python/mypy/issues/7281
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5967f261ae157c1997f31e290d6e46b4f3b5085aebe19f6e8d603b408078ffd7/python/mypy/issues/7281
og:image:altI've got an obscure bug which I narrowed down to some cache issues when you have a local class inheriting from NamedTuple. Stacktrace: Traceback (most recent call last): File "/home/karlicos/.local...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekarlicoss
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/7281#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F7281
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%2F7281
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/7281
Reloadhttps://github.com/python/mypy/issues/7281
Reloadhttps://github.com/python/mypy/issues/7281
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/7281
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/7281
#10432https://github.com/python/mypy/pull/10432
"AssertionError: Cannot find component" for local NamedTuplehttps://github.com/python/mypy/issues/7281#top
#10432https://github.com/python/mypy/pull/10432
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/karlicoss
karlicosshttps://github.com/karlicoss
on Aug 2, 2019https://github.com/python/mypy/issues/7281#issue-476239511
#2931https://github.com/python/mypy/issues/2931
Nexthttps://github.com/python/mypy/issues/7281?timeline_page=1
karlicosshttps://github.com/karlicoss
on Aug 2, 2019https://github.com/python/mypy/issues/7281#event-2530056274
get around python/mypy#7281https://github.com/karlicoss/cachew/commit/09cedfcf48cb16e67b2b648a514deb21083878f9
python/mypy#7281https://github.com/python/mypy/issues/7281
09cedfchttps://github.com/karlicoss/cachew/commit/09cedfcf48cb16e67b2b648a514deb21083878f9
msullivanhttps://github.com/msullivan
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 Aug 2, 2019https://github.com/python/mypy/issues/7281#event-2530429312
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
on Aug 7, 2019https://github.com/python/mypy/issues/7281#issuecomment-519065367
#6422https://github.com/python/mypy/issues/6422
https://github.com/languitar
languitarhttps://github.com/languitar
on Dec 13, 2019https://github.com/python/mypy/issues/7281#issuecomment-565384301
https://github.com/The-Compiler
The-Compilerhttps://github.com/The-Compiler
on Jan 12, 2020https://github.com/python/mypy/issues/7281#issuecomment-573456449
The-Compilerhttps://github.com/The-Compiler
on Jan 12, 2020https://github.com/python/mypy/issues/7281#event-2941560207
Work around mypy bughttps://github.com/qutebrowser/qutebrowser/commit/ee31e285b935ba4bcdef1f2f0bed9afbd2c7a0ae
ee31e28https://github.com/qutebrowser/qutebrowser/commit/ee31e285b935ba4bcdef1f2f0bed9afbd2c7a0ae
Work around mypy bughttps://github.com/qutebrowser/qutebrowser/commit/290a0f0c81ee6a00d311e8635799f92006804e61
290a0f0https://github.com/qutebrowser/qutebrowser/commit/290a0f0c81ee6a00d311e8635799f92006804e61
anderskhttps://github.com/andersk
on May 28, 2020https://github.com/python/mypy/issues/7281#event-3385001017
bugdown: Revert NamedTuple declarations to old style.https://github.com/andersk/zulip/commit/26f5d158816998459a7c9570d82a3718a91f088e
26f5d15https://github.com/andersk/zulip/commit/26f5d158816998459a7c9570d82a3718a91f088e
timabbotthttps://github.com/timabbott
on May 28, 2020https://github.com/python/mypy/issues/7281#event-3385076651
bugdown: Revert NamedTuple declarations to old style.https://github.com/zulip/zulip/commit/ba7906a3c657905fa35bbcfb4e97b053f050272d
ba7906ahttps://github.com/zulip/zulip/commit/ba7906a3c657905fa35bbcfb4e97b053f050272d
https://github.com/Osdel
Osdelhttps://github.com/Osdel
on Aug 21, 2020https://github.com/python/mypy/issues/7281#issuecomment-678404240
https://github.com/Gollum999
Gollum999https://github.com/Gollum999
on Aug 27, 2020https://github.com/python/mypy/issues/7281#issuecomment-682074217
https://github.com/vincent-prz
vincent-przhttps://github.com/vincent-prz
on Sep 2, 2020https://github.com/python/mypy/issues/7281#issuecomment-685523319
https://github.com/bobbyrullo
bobbyrullohttps://github.com/bobbyrullo
on Oct 15, 2020https://github.com/python/mypy/issues/7281#issuecomment-709445581
https://github.com/PaulCordo
PaulCordohttps://github.com/PaulCordo
on Oct 30, 2020https://github.com/python/mypy/issues/7281#issuecomment-719655048
JukkaLhttps://github.com/JukkaL
on May 6, 2021https://github.com/python/mypy/issues/7281#event-4695727967
Fix crash with type alias inside __init__ in incremental mode (#10432)https://github.com/python/mypy/commit/0964d9e65b2c6a341fe5fc8120240f832b95e9c3
#10432https://github.com/python/mypy/pull/10432
https://docs.github.com/articles/closing-issues-via-commit-messages
0964d9ehttps://github.com/python/mypy/commit/0964d9e65b2c6a341fe5fc8120240f832b95e9c3
https://github.com/andersk
anderskhttps://github.com/andersk
on Aug 3, 2021https://github.com/python/mypy/issues/7281#issuecomment-891513539
#10913https://github.com/python/mypy/issues/10913
https://github.com/ritajie
ritajiehttps://github.com/ritajie
on Oct 21, 2021https://github.com/python/mypy/issues/7281#issuecomment-948528609
https://github.com/mgasner
mgasnerhttps://github.com/mgasner
on Nov 29, 2021https://github.com/python/mypy/issues/7281#issuecomment-981873877
bryevdvhttps://github.com/bryevdv
on Dec 13, 2021https://github.com/python/mypy/issues/7281#event-5758983035
Improve static typing in `bokeh.command` (#11225)https://github.com/bokeh/bokeh/commit/94c01e9a5c2b1b796f533ef807b4a93ecf90757f
#11225https://github.com/bokeh/bokeh/pull/11225
94c01e9https://github.com/bokeh/bokeh/commit/94c01e9a5c2b1b796f533ef807b4a93ecf90757f
https://github.com/coding-today
coding-todayhttps://github.com/coding-today
on Feb 15, 2022https://github.com/python/mypy/issues/7281#issuecomment-1040058459
https://github.com/smackesey
smackeseyhttps://github.com/smackesey
on May 4, 2022https://github.com/python/mypy/issues/7281#issuecomment-1117792239
@JukkaLhttps://github.com/JukkaL
https://github.com/ericbn
ericbnhttps://github.com/ericbn
on May 18, 2022https://github.com/python/mypy/issues/7281#issuecomment-1130398975
https://github.com/roedoejet
roedoejethttps://github.com/roedoejet
on Dec 2, 2022https://github.com/python/mypy/issues/7281#issuecomment-1335949530
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Dec 2, 2022https://github.com/python/mypy/issues/7281#issuecomment-1335950470
https://github.com/roedoejet
roedoejethttps://github.com/roedoejet
on Dec 2, 2022https://github.com/python/mypy/issues/7281#issuecomment-1335951706
https://github.com/ydirson
ydirsonhttps://github.com/ydirson
on Dec 8, 2022https://github.com/python/mypy/issues/7281#issuecomment-1341791020
this code basehttps://gitlab.com/omaha-bgg/omaha/-/commits/bug/mypy-7281
https://github.com/mccauleyp
mccauleyphttps://github.com/mccauleyp
on Dec 27, 2022https://github.com/python/mypy/issues/7281#issuecomment-1366257052
typeddjango/django-stubs#760https://github.com/typeddjango/django-stubs/issues/760
https://github.com/dbetm
dbetmhttps://github.com/dbetm
on Apr 25, 2023https://github.com/python/mypy/issues/7281#issuecomment-1522124169
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Apr 25, 2023https://github.com/python/mypy/issues/7281#issuecomment-1522125859
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/7281
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/7281
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.