René's URL Explorer Experiment


Title: Crash using NamedTuple containing generic Callable · Issue #9914 · python/mypy · GitHub

Open Graph Title: Crash using NamedTuple containing generic Callable · Issue #9914 · python/mypy

X Title: Crash using NamedTuple containing generic Callable · Issue #9914 · python/mypy

Description: Crash Report Given a source file containing: class ProgressLogger(NamedTuple): progress: Callable[[T], T] where that type is used in another file as an annotation: def bar(progress_logger: ProgressLogger) -> None: pass Note that this doe...

Open Graph Description: Crash Report Given a source file containing: class ProgressLogger(NamedTuple): progress: Callable[[T], T] where that type is used in another file as an annotation: def bar(progress_logger: Progress...

X Description: Crash Report Given a source file containing: class ProgressLogger(NamedTuple): progress: Callable[[T], T] where that type is used in another file as an annotation: def bar(progress_logger: Progress...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash using NamedTuple containing generic Callable","articleBody":"**Crash Report**\r\n\r\nGiven a source file containing:\r\n``` python\r\nclass ProgressLogger(NamedTuple):\r\n    progress: Callable[[T], T]\r\n```\r\nwhere that type is used in another file as an annotation:\r\n``` python\r\ndef bar(progress_logger: ProgressLogger) -> None:\r\n    pass\r\n```\r\n\r\nNote that this doesn't reproduce if the function is within the same file as the type definitions. In that case `mypy` completes without complaint.\r\n\r\n**Traceback**\r\n\r\n```\r\n# Using mypy from git at 92923b2ed8085a38c353382f805c9e2e8716e717\r\n(mypy) peter@Tarasque:mypy (master)$ mypy /tmp/repro/project/ --show-traceback\r\n/tmp/repro/project/consumer.py:4: error: INTERNAL ERROR -- Please try using mypy master on Github:\r\nhttps://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build\r\nPlease report a bug at https://github.com/python/mypy/issues\r\nversion: 0.800+dev.92923b2ed8085a38c353382f805c9e2e8716e717\r\nTraceback (most recent call last):\r\n  File \"/home/peter/.virtualenvs/mypy/bin/mypy\", line 33, in \u003cmodule>\r\n    sys.exit(load_entry_point('mypy', 'console_scripts', 'mypy')())\r\n  File \"/home/play/mypy/mypy/__main__.py\", line 11, in console_entry\r\n    main(None, sys.stdout, sys.stderr)\r\n  File \"/home/play/mypy/mypy/main.py\", line 90, in main\r\n    res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)\r\n  File \"/home/play/mypy/mypy/build.py\", line 180, in build\r\n    result = _build(\r\n  File \"/home/play/mypy/mypy/build.py\", line 254, in _build\r\n    graph = dispatch(sources, manager, stdout)\r\n  File \"/home/play/mypy/mypy/build.py\", line 2638, in dispatch\r\n    process_graph(graph, manager)\r\n  File \"/home/play/mypy/mypy/build.py\", line 2964, in process_graph\r\n    process_stale_scc(graph, scc, manager)\r\n  File \"/home/play/mypy/mypy/build.py\", line 3056, in process_stale_scc\r\n    mypy.semanal_main.semantic_analysis_for_scc(graph, scc, manager.errors)\r\n  File \"/home/play/mypy/mypy/semanal_main.py\", line 79, in semantic_analysis_for_scc\r\n    process_functions(graph, scc, patches)\r\n  File \"/home/play/mypy/mypy/semanal_main.py\", line 233, in process_functions\r\n    process_top_level_function(analyzer,\r\n  File \"/home/play/mypy/mypy/semanal_main.py\", line 274, in process_top_level_function\r\n    deferred, incomplete, progress = semantic_analyze_target(target, state, node, active_type,\r\n  File \"/home/play/mypy/mypy/semanal_main.py\", line 326, in semantic_analyze_target\r\n    analyzer.refresh_partial(refresh_node,\r\n  File \"/home/play/mypy/mypy/semanal.py\", line 397, in refresh_partial\r\n    self.accept(node)\r\n  File \"/home/play/mypy/mypy/semanal.py\", line 4835, in accept\r\n    node.accept(self)\r\n  File \"/home/play/mypy/mypy/nodes.py\", line 687, in accept\r\n    return visitor.visit_func_def(self)\r\n  File \"/home/play/mypy/mypy/semanal.py\", line 573, in visit_func_def\r\n    self.analyze_func_def(defn)\r\n  File \"/home/play/mypy/mypy/semanal.py\", line 602, in analyze_func_def\r\n    result = analyzer.visit_callable_type(defn.type, nested=False)\r\n  File \"/home/play/mypy/mypy/typeanal.py\", line 527, in visit_callable_type\r\n    ret = t.copy_modified(arg_types=self.anal_array(t.arg_types, nested=nested),\r\n  File \"/home/play/mypy/mypy/typeanal.py\", line 929, in anal_array\r\n    res.append(self.anal_type(t, nested))\r\n  File \"/home/play/mypy/mypy/typeanal.py\", line 936, in anal_type\r\n    return t.accept(self)\r\n  File \"/home/play/mypy/mypy/types.py\", line 490, in accept\r\n    return visitor.visit_unbound_type(self)\r\n  File \"/home/play/mypy/mypy/typeanal.py\", line 163, in visit_unbound_type\r\n    typ = self.visit_unbound_type_nonoptional(t, defining_literal)\r\n  File \"/home/play/mypy/mypy/typeanal.py\", line 252, in visit_unbound_type_nonoptional\r\n    return self.analyze_type_with_type_info(node, t.args, t)\r\n  File \"/home/play/mypy/mypy/typeanal.py\", line 385, in analyze_type_with_type_info\r\n    return tup.copy_modified(items=self.anal_array(tup.items),\r\n  File \"/home/play/mypy/mypy/typeanal.py\", line 929, in anal_array\r\n    res.append(self.anal_type(t, nested))\r\n  File \"/home/play/mypy/mypy/typeanal.py\", line 936, in anal_type\r\n    return t.accept(self)\r\n  File \"/home/play/mypy/mypy/types.py\", line 1137, in accept\r\n    return visitor.visit_callable_type(self)\r\n  File \"/home/play/mypy/mypy/typeanal.py\", line 526, in visit_callable_type\r\n    variables = self.bind_function_type_variables(t, t)\r\n  File \"/home/play/mypy/mypy/typeanal.py\", line 900, in bind_function_type_variables\r\n    assert var_node, \"Binding for function type variable not found within function\"\r\nAssertionError: Binding for function type variable not found within function\r\n/tmp/repro/project/consumer.py:4: : note: use --pdb to drop into pdb\r\n```\r\n\r\n**To Reproduce**\r\n\r\nInitially observed in https://github.com/thread/django-lightweight-queue/pull/42, specifically https://github.com/thread/django-lightweight-queue/blob/7c8a2dc066acdf22bdfad88f2d2519f90155f209/django_lightweight_queue/backends/reliable_redis.py#L114-L119.\r\n\r\nCut-down to: https://gist.github.com/PeterJCLaw/00b0f5c5a5a6abcf53d2b6d6a8d142c6\r\n\r\n**Your Environment**\r\n\r\nInitially observed under Python 3.5.10, Mypy 0.770. Reproduced under Mypy 0.790.\r\nAlso reproduced on `master` at 92923b2ed8085a38c353382f805c9e2e8716e717 under Python 3.8.5.\r\n\r\nOS: Ubuntu 20.04.1.","author":{"url":"https://github.com/PeterJCLaw","@type":"Person","name":"PeterJCLaw"},"datePublished":"2021-01-15T20:06:02Z","url":"https://github.com/python/mypy/issues/9914"}

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:f809a139-e0a0-0ae7-d917-07b15c1dcfb0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCA7C:2B41BC:4F1585:6A46E9:6B002F41
html-safe-noncee56eb40e15a28af87f6f28a9ca52e30ff4ec5e03da51193cfc661d3ab9d82e05
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTdDOjJCNDFCQzo0RjE1ODU6NkE0NkU5OjZCMDAyRjQxIiwidmlzaXRvcl9pZCI6IjQxNTE5MDIxMjUxMjA2NzM5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaca29c3d9bc1ea313fbc21f1ceb446503ecce75d0b83aee1910e1b861b2109a66c
hovercard-subject-tagissue:787161989
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/9914/issue_layout
twitter:imagehttps://opengraph.githubassets.com/820f0805427fea5eb9518354e2e7a000ba653d570737cc990e02c4bcc399c783/python/mypy/issues/9914
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/820f0805427fea5eb9518354e2e7a000ba653d570737cc990e02c4bcc399c783/python/mypy/issues/9914
og:image:altCrash Report Given a source file containing: class ProgressLogger(NamedTuple): progress: Callable[[T], T] where that type is used in another file as an annotation: def bar(progress_logger: Progress...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamePeterJCLaw
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/9914#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fissues%2F9914
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%2F9914
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/9914
Reloadhttps://github.com/python/mypy/issues/9914
Reloadhttps://github.com/python/mypy/issues/9914
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/9914
New issuehttps://github.com/login?return_to=https://github.com/python/mypy/issues/9914
Crash using NamedTuple containing generic Callablehttps://github.com/python/mypy/issues/9914#top
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
topic-named-tuplehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-named-tuple%22
https://github.com/PeterJCLaw
PeterJCLawhttps://github.com/PeterJCLaw
on Jan 15, 2021https://github.com/python/mypy/issues/9914#issue-787161989
thread/django-lightweight-queue#42https://github.com/thread/django-lightweight-queue/pull/42
https://github.com/thread/django-lightweight-queue/blob/7c8a2dc066acdf22bdfad88f2d2519f90155f209/django_lightweight_queue/backends/reliable_redis.py#L114-L119https://github.com/thread/django-lightweight-queue/blob/7c8a2dc066acdf22bdfad88f2d2519f90155f209/django_lightweight_queue/backends/reliable_redis.py#L114-L119
https://gist.github.com/PeterJCLaw/00b0f5c5a5a6abcf53d2b6d6a8d142c6https://gist.github.com/PeterJCLaw/00b0f5c5a5a6abcf53d2b6d6a8d142c6
92923b2https://github.com/python/mypy/commit/92923b2ed8085a38c353382f805c9e2e8716e717
PeterJCLawhttps://github.com/PeterJCLaw
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
on Jan 15, 2021https://github.com/python/mypy/issues/9914#event-4212760137
https://github.com/PeterJCLaw
PeterJCLawhttps://github.com/PeterJCLaw
on Jan 15, 2021https://github.com/python/mypy/issues/9914#issuecomment-761173404
PeterJCLawhttps://github.com/PeterJCLaw
on Jan 15, 2021https://github.com/python/mypy/issues/9914#event-4212785963
Work around python/mypy#9914https://github.com/thread/django-lightweight-queue/commit/2d8df1150b0c3b7d02ef5c14faa063fa871ff0dd
python/mypy#9914https://github.com/python/mypy/issues/9914
2d8df11https://github.com/thread/django-lightweight-queue/commit/2d8df1150b0c3b7d02ef5c14faa063fa871ff0dd
PeterJCLawhttps://github.com/PeterJCLaw
on Jan 27, 2021https://github.com/python/mypy/issues/9914#event-4255664403
Work around python/mypy#9914 (again)https://github.com/thread/django-lightweight-queue/commit/b212266c0105d56a087fb8e5f40bf982bedbe7c2
python/mypy#9914https://github.com/python/mypy/issues/9914
b212266https://github.com/thread/django-lightweight-queue/commit/b212266c0105d56a087fb8e5f40bf982bedbe7c2
AlexWaygoodhttps://github.com/AlexWaygood
topic-named-tuplehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-named-tuple%22
on Mar 26, 2022https://github.com/python/mypy/issues/9914#event-6311420877
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
on Sep 12, 2022https://github.com/python/mypy/issues/9914#issuecomment-1243159278
#13371https://github.com/python/mypy/pull/13371
Michael0x2ahttps://github.com/Michael0x2a
completedhttps://github.com/python/mypy/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 12, 2022https://github.com/python/mypy/issues/9914#event-7363639373
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/mypy/issues/9914
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/mypy/issues/9914
crashhttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22crash%22
topic-named-tuplehttps://github.com/python/mypy/issues?q=state%3Aopen%20label%3A%22topic-named-tuple%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.