René's URL Explorer Experiment


Title: Introduce a helper function to map types to protocols + fix for dict kwargs false positive by randolf-scholz · Pull Request #20419 · python/mypy · GitHub

Open Graph Title: Introduce a helper function to map types to protocols + fix for dict kwargs false positive by randolf-scholz · Pull Request #20419 · python/mypy

X Title: Introduce a helper function to map types to protocols + fix for dict kwargs false positive by randolf-scholz · Pull Request #20419 · python/mypy

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

Open Graph Description: Fixes: #20424 Following my comments in #20416, this PR introduces a new helper function as_type that can be used to determine whether a type can be matched to a certain protocol or not. As an examp...

X Description: Fixes: #20424 Following my comments in #20416, this PR introduces a new helper function as_type that can be used to determine whether a type can be matched to a certain protocol or not. As an examp...

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

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:43116016-74a3-1ac9-467a-72c956e1b0dd
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB560:3A7693:2343D47:2FD9985:6B00291B
html-safe-nonce67f7d92a21ec899da4acae60cba9cc56fb310a1f8b75a48095fe846b81985de0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTYwOjNBNzY5MzoyMzQzRDQ3OjJGRDk5ODU6NkIwMDI5MUIiLCJ2aXNpdG9yX2lkIjoiODg1NzQ2OTUxMTExNzMxODQyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac74519ff3285d8ffabf2a81f9128fe457192ade80c7e6c65d2b46e32927735f01
hovercard-subject-tagpull_request:3103702315
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/20419/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/d6edd26eec1cc6e1b6e02a6fbb57432c3608d3d7d94c9dd9857d83609af71607/python/mypy/pull/20419
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d6edd26eec1cc6e1b6e02a6fbb57432c3608d3d7d94c9dd9857d83609af71607/python/mypy/pull/20419
og:image:altFixes: #20424 Following my comments in #20416, this PR introduces a new helper function as_type that can be used to determine whether a type can be matched to a certain protocol or not. As an examp...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerandolf-scholz
hostnamegithub.com
expected-hostnamegithub.com
None4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0
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
release44c658b24abf00491fb7ae5f56d42c9f38cbeab2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/python/mypy/pull/20419#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20419
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%2F20419
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/20419
Reloadhttps://github.com/python/mypy/pull/20419
Reloadhttps://github.com/python/mypy/pull/20419
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
randolf-scholzhttps://github.com/randolf-scholz
python:masterhttps://github.com/python/mypy/tree/master
randolf-scholz:fix_good_kwhttps://github.com/randolf-scholz/mypy/tree/fix_good_kw
Conversationhttps://github.com/python/mypy/pull/20419
Commits7 (7)https://github.com/python/mypy/pull/20419/commits
Checkshttps://github.com/python/mypy/pull/20419/checks
Files changedhttps://github.com/python/mypy/pull/20419/files
Introduce a helper function to map types to protocols + fix for dict kwargs false positivehttps://github.com/python/mypy/pull/20419#top
randolf-scholzhttps://github.com/randolf-scholz
python:masterhttps://github.com/python/mypy/tree/master
randolf-scholz:fix_good_kwhttps://github.com/randolf-scholz/mypy/tree/fix_good_kw
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
Dec 15, 2025https://github.com/python/mypy/pull/20419#issue-3731773893
Please reload this pagehttps://github.com/python/mypy/pull/20419
#20424https://github.com/python/mypy/issues/20424
#20416https://github.com/python/mypy/pull/20416
Please reload this pagehttps://github.com/python/mypy/pull/20419
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20419
Allow literals as kwargs dict keys #20416 https://github.com/python/mypy/pull/20416
False positive error on **kwargs with Mapping[Literal, Any] type #20424 https://github.com/python/mypy/issues/20424
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
Dec 16, 2025 https://github.com/python/mypy/pull/20419#pullrequestreview-3582073084
View reviewed changes https://github.com/python/mypy/pull/20419/files
mypy/maptype.pyhttps://github.com/python/mypy/pull/20419/files#diff-670f0d65666c1cda64c5bcf20d0d2407d2a52e8bb4d073fae941a46914870892
randolf-scholzhttps://github.com/randolf-scholz
Dec 16, 2025https://github.com/python/mypy/pull/20419#discussion_r2622426292
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/20419
ilevkivskyihttps://github.com/ilevkivskyi
Dec 17, 2025https://github.com/python/mypy/pull/20419#discussion_r2625383081
Please reload this pagehttps://github.com/python/mypy/pull/20419
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/20419
randolf-scholzhttps://github.com/randolf-scholz
Dec 17, 2025https://github.com/python/mypy/pull/20419#discussion_r2627595681
Please reload this pagehttps://github.com/python/mypy/pull/20419
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/20419
ilevkivskyihttps://github.com/ilevkivskyi
Jan 2, 2026https://github.com/python/mypy/pull/20419#discussion_r2658205731
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/20419
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
Dec 16, 2025 https://github.com/python/mypy/pull/20419#pullrequestreview-3582076312
View reviewed changes https://github.com/python/mypy/pull/20419/files
mypy/maptype.pyhttps://github.com/python/mypy/pull/20419/files#diff-670f0d65666c1cda64c5bcf20d0d2407d2a52e8bb4d073fae941a46914870892
Please reload this pagehttps://github.com/python/mypy/pull/20419
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20419
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
Dec 18, 2025https://github.com/python/mypy/pull/20419#issuecomment-3668171103
#20435https://github.com/python/mypy/issues/20435
Please reload this pagehttps://github.com/python/mypy/pull/20419
randolf-scholzhttps://github.com/randolf-scholz
December 19, 2025 15:30https://github.com/python/mypy/pull/20419#commits-pushed-8003458
https://github.com/randolf-scholz
added utility for mapping types to instanceshttps://github.com/python/mypy/pull/20419/commits/800345831769a379e343faaf5d27db8d9d19ce72
8003458https://github.com/python/mypy/pull/20419/commits/800345831769a379e343faaf5d27db8d9d19ce72
https://github.com/randolf-scholz
introduced helper function to map type to protocolhttps://github.com/python/mypy/pull/20419/commits/1ea4d1e17cada93e9fd006c7565fd5a84ff81b88
1ea4d1ehttps://github.com/python/mypy/pull/20419/commits/1ea4d1e17cada93e9fd006c7565fd5a84ff81b88
https://github.com/randolf-scholz
test also custom key+getitem classhttps://github.com/python/mypy/pull/20419/commits/5482d98a40ca875f7c2f229f3a17031323b89c9b
5482d98https://github.com/python/mypy/pull/20419/commits/5482d98a40ca875f7c2f229f3a17031323b89c9b
https://github.com/randolf-scholz
renamed and moved function to subtypeshttps://github.com/python/mypy/pull/20419/commits/8cc1c298fd1e18c6e873c2b75cdc6b6183b6e90e
8cc1c29https://github.com/python/mypy/pull/20419/commits/8cc1c298fd1e18c6e873c2b75cdc6b6183b6e90e
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
force-pushedhttps://github.com/python/mypy/compare/05e0a4168e7fe49b5e6d373fbe9a24ad9ef2e92a..8cc1c298fd1e18c6e873c2b75cdc6b6183b6e90e
05e0a41https://github.com/python/mypy/commit/05e0a4168e7fe49b5e6d373fbe9a24ad9ef2e92a
8cc1c29https://github.com/python/mypy/commit/8cc1c298fd1e18c6e873c2b75cdc6b6183b6e90e
Compare https://github.com/python/mypy/compare/05e0a4168e7fe49b5e6d373fbe9a24ad9ef2e92a..8cc1c298fd1e18c6e873c2b75cdc6b6183b6e90e
December 19, 2025 15:10https://github.com/python/mypy/pull/20419#event-21672767246
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
Dec 19, 2025https://github.com/python/mypy/pull/20419#issuecomment-3675470819
Please reload this pagehttps://github.com/python/mypy/pull/20419
Please reload this pagehttps://github.com/python/mypy/pull/20419
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20419
https://github.com/randolf-scholz
reworked is_valid_keyword_var_arghttps://github.com/python/mypy/pull/20419/commits/364b0686b0b7d9468d1380b627a753b3c5456332
364b068https://github.com/python/mypy/pull/20419/commits/364b0686b0b7d9468d1380b627a753b3c5456332
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
Dec 19, 2025https://github.com/python/mypy/pull/20419#issuecomment-3675820865
https://mypy-play.net/?mypy=master&python=3.12&gist=5bd4a2ba27f5d5edec09efb4486f65d9https://mypy-play.net/?mypy=master&python=3.12&gist=5bd4a2ba27f5d5edec09efb4486f65d9
Please reload this pagehttps://github.com/python/mypy/pull/20419
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
Dec 19, 2025 https://github.com/python/mypy/pull/20419#ref-issue-3748167837
Check #20419 sterliakov/mypy-issues#232 https://github.com/sterliakov/mypy-issues/issues/232
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20419
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Jan 2, 2026 https://github.com/python/mypy/pull/20419#pullrequestreview-3623655361
View reviewed changes https://github.com/python/mypy/pull/20419/files/364b0686b0b7d9468d1380b627a753b3c5456332
ilevkivskyihttps://github.com/ilevkivskyi
https://github.com/python/mypy/pull/20419#pullrequestreview-3623655361
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/20419
test-data/unit/check-parameter-specification.testhttps://github.com/python/mypy/pull/20419/files/364b0686b0b7d9468d1380b627a753b3c5456332#diff-2e10fe01ef2dee920c159f4016e58f4e404778ee98b61ace3a757ca0ed69a811
Please reload this pagehttps://github.com/python/mypy/pull/20419
mypy/maptype.pyhttps://github.com/python/mypy/pull/20419/files#diff-670f0d65666c1cda64c5bcf20d0d2407d2a52e8bb4d073fae941a46914870892
Please reload this pagehttps://github.com/python/mypy/pull/20419
mypy/subtypes.pyhttps://github.com/python/mypy/pull/20419/files/364b0686b0b7d9468d1380b627a753b3c5456332#diff-3641fc675bdf772ec816dbb1b8ef258e9f07c15f604d83d7549bf7b873757a54
ilevkivskyihttps://github.com/ilevkivskyi
Jan 2, 2026https://github.com/python/mypy/pull/20419#discussion_r2658201884
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/20419
randolf-scholzhttps://github.com/randolf-scholz
Jan 3, 2026https://github.com/python/mypy/pull/20419#discussion_r2658824097
Please reload this pagehttps://github.com/python/mypy/pull/20419
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
1https://github.com/python/mypy/pull/20419#user-content-fn-1-61df053aaf1b883ad9de697673a790e4
https://github.com/python/mypy/blob/0cc21d99b8ab0c587fca66b697a50e6b59abf06d/mypy/constraints.py#L399-L408https://github.com/python/mypy/blob/0cc21d99b8ab0c587fca66b697a50e6b59abf06d/mypy/constraints.py#L399-L408
↩https://github.com/python/mypy/pull/20419#user-content-fnref-1-61df053aaf1b883ad9de697673a790e4
Please reload this pagehttps://github.com/python/mypy/pull/20419
randolf-scholzhttps://github.com/randolf-scholz
Jan 3, 2026https://github.com/python/mypy/pull/20419#discussion_r2658839602
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
#20516https://github.com/python/mypy/issues/20516
Please reload this pagehttps://github.com/python/mypy/pull/20419
ilevkivskyihttps://github.com/ilevkivskyi
Jan 4, 2026https://github.com/python/mypy/pull/20419#discussion_r2659232860
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
#20516https://github.com/python/mypy/issues/20516
Please reload this pagehttps://github.com/python/mypy/pull/20419
randolf-scholzhttps://github.com/randolf-scholz
Jan 4, 2026https://github.com/python/mypy/pull/20419#discussion_r2659458917
Please reload this pagehttps://github.com/python/mypy/pull/20419
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
#20419 (comment)https://github.com/python/mypy/pull/20419#discussion_r2658824097
Please reload this pagehttps://github.com/python/mypy/pull/20419
mypy/maptype.pyhttps://github.com/python/mypy/pull/20419/files#diff-670f0d65666c1cda64c5bcf20d0d2407d2a52e8bb4d073fae941a46914870892
ilevkivskyihttps://github.com/ilevkivskyi
Jan 2, 2026https://github.com/python/mypy/pull/20419#discussion_r2658205731
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/20419
https://github.com/randolf-scholz
https://github.com/ilevkivskyi
Update test-data/unit/check-parameter-specification.testhttps://github.com/python/mypy/pull/20419/commits/35eb5bab5c7fd27e478eaed76d9f31ee919d8014
35eb5bahttps://github.com/python/mypy/pull/20419/commits/35eb5bab5c7fd27e478eaed76d9f31ee919d8014
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20419
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
Jan 3, 2026 https://github.com/python/mypy/pull/20419#ref-issue-3777922117
False positive when assigning bounded generic to union including the bound #20516 https://github.com/python/mypy/issues/20516
https://github.com/randolf-scholz
Merge branch 'master' into fix_good_kwhttps://github.com/python/mypy/pull/20419/commits/718af1f858234f2cbd7ffae86ce5a502c39ad9af
718af1fhttps://github.com/python/mypy/pull/20419/commits/718af1f858234f2cbd7ffae86ce5a502c39ad9af
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
Feb 5, 2026https://github.com/python/mypy/pull/20419#issuecomment-3855698706
mypy_primerhttps://github.com/hauntsaninja/mypy_primer
Please reload this pagehttps://github.com/python/mypy/pull/20419
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%2F20419
https://github.com/ilevkivskyi
ilevkivskyi https://github.com/ilevkivskyi
https://github.com/python/mypy/pull/20419/files/364b0686b0b7d9468d1380b627a753b3c5456332
Please reload this pagehttps://github.com/python/mypy/pull/20419
False positive error on **kwargs with Mapping[Literal, Any] type https://github.com/python/mypy/issues/20424
Please reload this pagehttps://github.com/python/mypy/pull/20419
https://github.com/randolf-scholz
https://github.com/sterliakov
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.