René's URL Explorer Experiment


Title: Fix invalid contextual inference for generic call arguments by rheard · Pull Request #21803 · python/mypy · GitHub

Open Graph Title: Fix invalid contextual inference for generic call arguments by rheard · Pull Request #21803 · python/mypy

X Title: Fix invalid contextual inference for generic call arguments by rheard · Pull Request #21803 · python/mypy

Description: Optional static typing for Python. Contribute to python/mypy development by creating an account on GitHub.

Open Graph Description: Fixes: Assigning to intermediate variable changes type checking results #19304 Inferred attribute type feeds back as call context, rejecting its own defining assignment #21809 error: "key&quo...

X Description: Fixes: Assigning to intermediate variable changes type checking results #19304 Inferred attribute type feeds back as call context, rejecting its own defining assignment #21809 error: "key...

Opengraph URL: https://github.com/python/mypy/pull/21803

X: @github

direct link

Domain: github.com

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/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:2b2a49a0-0397-048e-6743-c91cce33637f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9032:2148FB:1A1FFD0:2335CA9:6AFFFB2E
html-safe-nonce6ed7aef44ae63e3cdb37888a7fa03332144c6530100173f919c0c164c39e29d9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDMyOjIxNDhGQjoxQTFGRkQwOjIzMzVDQTk6NkFGRkZCMkUiLCJ2aXNpdG9yX2lkIjoiMTY2MDgxMjMxNTU1MDgwODg3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacbb706999ee118713de8dd54a73c01a14e7c356a8a66e49aa87b33ff5b1c27bfd
hovercard-subject-tagpull_request:4189518322
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/mypy/21803/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/75ab331c1e13d2cf4c1d096f2c1b36350b2e882b3fd46b0b5a86beb9fc5e4c70/python/mypy/pull/21803
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/75ab331c1e13d2cf4c1d096f2c1b36350b2e882b3fd46b0b5a86beb9fc5e4c70/python/mypy/pull/21803
og:image:altFixes: Assigning to intermediate variable changes type checking results #19304 Inferred attribute type feeds back as call context, rejecting its own defining assignment #21809 error: "key&quo...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerheard
hostnamegithub.com
expected-hostnamegithub.com
None0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729
turbo-cache-controlno-cache
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-namepull-requests

Links:

Skip to contenthttps://github.com/python/mypy/pull/21803#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F21803
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%2Fpull%2F21803
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%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=python%2Fmypy
Reloadhttps://github.com/python/mypy/pull/21803
Reloadhttps://github.com/python/mypy/pull/21803
Reloadhttps://github.com/python/mypy/pull/21803
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
rheardhttps://github.com/rheard
python:masterhttps://github.com/python/mypy/tree/master
rheard:fix-19304https://github.com/rheard/mypy/tree/fix-19304
Conversationhttps://github.com/python/mypy/pull/21803
Commits1 (1)https://github.com/python/mypy/pull/21803/commits
Checkshttps://github.com/python/mypy/pull/21803/checks
Files changedhttps://github.com/python/mypy/pull/21803/files
Fix invalid contextual inference for generic call argumentshttps://github.com/python/mypy/pull/21803#top
rheardhttps://github.com/rheard
python:masterhttps://github.com/python/mypy/tree/master
rheard:fix-19304https://github.com/rheard/mypy/tree/fix-19304
https://github.com/rheard
rheardhttps://github.com/rheard
Aug 2, 2026https://github.com/python/mypy/pull/21803#issue-5044018682
Please reload this pagehttps://github.com/python/mypy/pull/21803
Assigning to intermediate variable changes type checking results #19304https://github.com/python/mypy/issues/19304
Inferred attribute type feeds back as call context, rejecting its own defining assignment #21809https://github.com/python/mypy/issues/21809
error: "key" to "max" has incompatible type #21104https://github.com/python/mypy/issues/21104
Parameter TypeVar unexpectedly becomes optional when unpacking call results #20219https://github.com/python/mypy/issues/20219
Argument "key" to "sorted" has incompatible type "Callable…" #19259https://github.com/python/mypy/issues/19259
bogus complaint when checking Callable arguments #18689https://github.com/python/mypy/issues/18689
mypy incorrectly complains about incompatible type error #18267https://github.com/python/mypy/issues/18267
False positive [operator] on union of dicts with heterogeneous value types #18236https://github.com/python/mypy/issues/18236
functools.reduce over sets becomes unacceptable when used in a larger expression #17694https://github.com/python/mypy/issues/17694
Function's argument type inference is affected by the functions return type when in a comprehension #17025https://github.com/python/mypy/issues/17025
MyPy reports errors when performing nested element access using a TypeVar-parameterized generic type #16953https://github.com/python/mypy/issues/16953
Generic type inferred wrong; curious difference betweer aiter(f(x)) and c = f(x); aiter(c) #16376https://github.com/python/mypy/issues/16376
Generic matching error when tuple-unpacking result #16310https://github.com/python/mypy/issues/16310
set.__and__ false-positive involving generic inference #15462https://github.com/python/mypy/issues/15462
Spurious error when adding two list #15087https://github.com/python/mypy/issues/15087
error in set unions #12760https://github.com/python/mypy/issues/12760
False positive for function that takes a Callable as a parameter and returns a Tuple of Union #10281https://github.com/python/mypy/issues/10281
Changing just the return type annotation causes incompatible argument error #10105https://github.com/python/mypy/issues/10105
Collapsed Optionals in TypeVar cause weird error messages #8478https://github.com/python/mypy/issues/8478
Covariant generic type context results in confusing message with __add__ #5971https://github.com/python/mypy/issues/5971
Mypy is still too eager about outer context #5874https://github.com/python/mypy/issues/5874
error in argument when using chained function-call #5311https://github.com/python/mypy/issues/5311
Apparent false positive when using reduce with dictionaries #4150https://github.com/python/mypy/issues/4150
Please reload this pagehttps://github.com/python/mypy/pull/21803
https://github.com/rheard
rheardhttps://github.com/rheard
Aug 2, 2026 https://github.com/python/mypy/pull/21803#ref-issue-3149932114
Assigning to intermediate variable changes type checking results #19304 https://github.com/python/mypy/issues/19304
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F21803
https://github.com/rheard
rheardhttps://github.com/rheard
force-pushedhttps://github.com/python/mypy/compare/3ba4377f11a33e8cf822e19a43c3e24d26fe5123..33fd7ada3adee69e47867415b692ac6f274233ee
3ba4377https://github.com/python/mypy/commit/3ba4377f11a33e8cf822e19a43c3e24d26fe5123
33fd7adhttps://github.com/python/mypy/commit/33fd7ada3adee69e47867415b692ac6f274233ee
Compare https://github.com/python/mypy/compare/3ba4377f11a33e8cf822e19a43c3e24d26fe5123..33fd7ada3adee69e47867415b692ac6f274233ee
August 2, 2026 22:38https://github.com/python/mypy/pull/21803#event-28859803828
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F21803
https://github.com/rheard
rheardhttps://github.com/rheard
force-pushedhttps://github.com/python/mypy/compare/33fd7ada3adee69e47867415b692ac6f274233ee..060c1aa7cea6d4775a0614c20eeeb6e47218bde2
33fd7adhttps://github.com/python/mypy/commit/33fd7ada3adee69e47867415b692ac6f274233ee
060c1aahttps://github.com/python/mypy/commit/060c1aa7cea6d4775a0614c20eeeb6e47218bde2
Compare https://github.com/python/mypy/compare/33fd7ada3adee69e47867415b692ac6f274233ee..060c1aa7cea6d4775a0614c20eeeb6e47218bde2
August 6, 2026 02:03https://github.com/python/mypy/pull/21803#event-29043276743
https://github.com/rheard
rheardhttps://github.com/rheard
Aug 6, 2026 https://github.com/python/mypy/pull/21803#ref-issue-5065631278
Inferred attribute type feeds back as call context, rejecting its own defining assignment #21809 https://github.com/python/mypy/issues/21809
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F21803
https://github.com/rheard
rheardhttps://github.com/rheard
force-pushedhttps://github.com/python/mypy/compare/060c1aa7cea6d4775a0614c20eeeb6e47218bde2..4eb3cee4cf37263d87ef01df5e9e232ec4e9e4c5
060c1aahttps://github.com/python/mypy/commit/060c1aa7cea6d4775a0614c20eeeb6e47218bde2
4eb3ceehttps://github.com/python/mypy/commit/4eb3cee4cf37263d87ef01df5e9e232ec4e9e4c5
Compare https://github.com/python/mypy/compare/060c1aa7cea6d4775a0614c20eeeb6e47218bde2..4eb3cee4cf37263d87ef01df5e9e232ec4e9e4c5
August 6, 2026 19:10https://github.com/python/mypy/pull/21803#event-29084000291
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F21803
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
Aug 25, 2026 https://github.com/python/mypy/pull/21803#ref-issue-5246709835
Check #21803 sterliakov/mypy-issues#309 https://github.com/sterliakov/mypy-issues/issues/309
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
Aug 25, 2026https://github.com/python/mypy/pull/21803#issuecomment-5412036202
sterliakov/mypy-issues#309https://github.com/sterliakov/mypy-issues/issues/309
randolf-scholz#4https://github.com/randolf-scholz/mypy/pull/4
Please reload this pagehttps://github.com/python/mypy/pull/21803
https://github.com/rheard
rheardhttps://github.com/rheard
force-pushedhttps://github.com/python/mypy/compare/8bf47dc675899f9e7152d0d542d432717c33bd71..8757530d1105168c2c6457f460e91661f97d2301
8bf47dchttps://github.com/python/mypy/commit/8bf47dc675899f9e7152d0d542d432717c33bd71
8757530https://github.com/python/mypy/commit/8757530d1105168c2c6457f460e91661f97d2301
Compare https://github.com/python/mypy/compare/8bf47dc675899f9e7152d0d542d432717c33bd71..8757530d1105168c2c6457f460e91661f97d2301
August 25, 2026 18:27https://github.com/python/mypy/pull/21803#event-29996492378
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F21803
https://github.com/rheard
rheardhttps://github.com/rheard
Aug 25, 2026https://github.com/python/mypy/pull/21803#issuecomment-5415392703
Please reload this pagehttps://github.com/python/mypy/pull/21803
@randolf-scholzhttps://github.com/randolf-scholz
#21809https://github.com/python/mypy/issues/21809
#5874https://github.com/python/mypy/issues/5874
#16522https://github.com/python/mypy/issues/16522
reran the checkshttps://github.com/sterliakov/mypy-issues/issues/309#issuecomment-5415381869
Please reload this pagehttps://github.com/python/mypy/pull/21803
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Oct 4, 2026 https://github.com/python/mypy/pull/21803#ref-issue-5617842093
Re-think our high level logic for type inference #22063 https://github.com/python/mypy/issues/22063
https://github.com/rheard
Fix invalid contextual inference for generic call argumentshttps://github.com/python/mypy/pull/21803/commits/eab6e5ad18cb85ec00da92f30c256c5db6d095bc
eab6e5ahttps://github.com/python/mypy/pull/21803/commits/eab6e5ad18cb85ec00da92f30c256c5db6d095bc
https://github.com/rheard
rheardhttps://github.com/rheard
force-pushedhttps://github.com/python/mypy/compare/8757530d1105168c2c6457f460e91661f97d2301..eab6e5ad18cb85ec00da92f30c256c5db6d095bc
8757530https://github.com/python/mypy/commit/8757530d1105168c2c6457f460e91661f97d2301
eab6e5ahttps://github.com/python/mypy/commit/eab6e5ad18cb85ec00da92f30c256c5db6d095bc
Compare https://github.com/python/mypy/compare/8757530d1105168c2c6457f460e91661f97d2301..eab6e5ad18cb85ec00da92f30c256c5db6d095bc
October 14, 2026 00:59https://github.com/python/mypy/pull/21803#event-33184661752
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
Oct 14, 2026https://github.com/python/mypy/pull/21803#issuecomment-6158717757
mypy_primerhttps://github.com/hauntsaninja/mypy_primer
Please reload this pagehttps://github.com/python/mypy/pull/21803
https://github.com/srittau
srittauhttps://github.com/srittau
Oct 28, 2026 https://github.com/python/mypy/pull/21803#ref-pullrequest-6078933504
Narrow MutableSet in-place operators python/typeshed#16634 https://github.com/python/typeshed/pull/16634
https://github.com/srittau
srittauhttps://github.com/srittau
Oct 28, 2026https://github.com/python/mypy/pull/21803#issuecomment-6471564283
python/typeshed#16634https://github.com/python/typeshed/pull/16634
Please reload this pagehttps://github.com/python/mypy/pull/21803
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Nov 8, 2026https://github.com/python/mypy/pull/21803#issuecomment-6724602181
#22286https://github.com/python/mypy/pull/22286
@rheardhttps://github.com/rheard
Please reload this pagehttps://github.com/python/mypy/pull/21803
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Nov 8, 2026https://github.com/python/mypy/pull/21803#event-35503806245
https://github.co/hiddenchars
https://github.com/python/mypy/pull/{{ revealButtonHref }}
Sign up for freehttps://github.com/join?source=comment-repo
Sign in to commenthttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F21803
Please reload this pagehttps://github.com/python/mypy/pull/21803
Please reload this pagehttps://github.com/python/mypy/pull/21803
https://github.com/rheard
https://github.com/randolf-scholz
https://github.com/srittau
https://github.com/ilevkivskyi
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.