René's URL Explorer Experiment


Title: Infer correct types with overloads of `Type[Guard | Is]` by sobolevn · Pull Request #17678 · python/mypy · GitHub

Open Graph Title: Infer correct types with overloads of `Type[Guard | Is]` by sobolevn · Pull Request #17678 · python/mypy

X Title: Infer correct types with overloads of `Type[Guard | Is]` by sobolevn · Pull Request #17678 · python/mypy

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

Open Graph Description: Closes #17579 Consider this as a prototype, because I understand that there might be a lot of extra work to get this right. However, this does solve this problem in the original issue.

X Description: Closes #17579 Consider this as a prototype, because I understand that there might be a lot of extra work to get this right. However, this does solve this problem in the original issue.

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

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:c8acc881-7fe2-b60e-129c-a93d17a2c8ed
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE7BC:18FDF5:88D28D:B5DFA6:6B003D55
html-safe-nonce0786ae299a83b758bea7a4c354797452a194d3e477a118c283055b0f9f99d759
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFN0JDOjE4RkRGNTo4OEQyOEQ6QjVERkE2OjZCMDAzRDU1IiwidmlzaXRvcl9pZCI6IjY5MTczNjcxNjA3MDg4MDgwMjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1f9f3998155f9279bfbee63afddd2096dac9b4dadbf29f1ac8ef75ecd6a415cd
hovercard-subject-tagpull_request:2019936803
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/17678/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/41756cdaddb22ec356071180a45f8bf5c0b30229dfa7ecfbe35d95640bfdd974/python/mypy/pull/17678
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/41756cdaddb22ec356071180a45f8bf5c0b30229dfa7ecfbe35d95640bfdd974/python/mypy/pull/17678
og:image:altCloses #17579 Consider this as a prototype, because I understand that there might be a lot of extra work to get this right. However, this does solve this problem in the original issue.
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesobolevn
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
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
releasef3f3a43ca095cdea3abbb394112e971f9fdb94fa
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/python/mypy/pull/17678#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F17678
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%2F17678
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/17678
Reloadhttps://github.com/python/mypy/pull/17678
Reloadhttps://github.com/python/mypy/pull/17678
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
sobolevnhttps://github.com/sobolevn
masterhttps://github.com/python/mypy/tree/master
overloads-type-narrower-inferencehttps://github.com/python/mypy/tree/overloads-type-narrower-inference
Conversationhttps://github.com/python/mypy/pull/17678
Commits3 (3)https://github.com/python/mypy/pull/17678/commits
Checkshttps://github.com/python/mypy/pull/17678/checks
Files changedhttps://github.com/python/mypy/pull/17678/files
Infer correct types with overloads of Type[Guard | Is]https://github.com/python/mypy/pull/17678#top
sobolevnhttps://github.com/sobolevn
masterhttps://github.com/python/mypy/tree/master
overloads-type-narrower-inferencehttps://github.com/python/mypy/tree/overloads-type-narrower-inference
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
Aug 14, 2024https://github.com/python/mypy/pull/17678#issue-2466607327
#17579https://github.com/python/mypy/issues/17579
Please reload this pagehttps://github.com/python/mypy/pull/17678
https://github.com/sobolevn
Infer correct types with overloads of Type[Guard | Is]https://github.com/python/mypy/pull/17678/commits/da33c20467708623bff691bafffd3fd214a1144b
da33c20https://github.com/python/mypy/pull/17678/commits/da33c20467708623bff691bafffd3fd214a1144b
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
JukkaLhttps://github.com/JukkaL
ilevkivskyihttps://github.com/ilevkivskyi
August 14, 2024 19:03https://github.com/python/mypy/pull/17678#event-13885699098
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
Aug 14, 2024 https://github.com/python/mypy/pull/17678#ref-issue-2422291120
is_dataclass(Any) return type incorrect, differs from is_dataclass(object) python/typeshed#12401 https://github.com/python/typeshed/issues/12401
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F17678
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
JelleZijlstrahttps://github.com/JelleZijlstra
hauntsaninjahttps://github.com/hauntsaninja
January 1, 2025 07:12https://github.com/python/mypy/pull/17678#event-15793009464
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
Jan 1, 2025https://github.com/python/mypy/pull/17678#issuecomment-2566883795
Please reload this pagehttps://github.com/python/mypy/pull/17678
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
Jan 17, 2025 https://github.com/python/mypy/pull/17678#pullrequestreview-2559269180
View reviewed changes https://github.com/python/mypy/pull/17678/files/da33c20467708623bff691bafffd3fd214a1144b
JukkaLhttps://github.com/JukkaL
https://github.com/python/mypy/pull/17678#pullrequestreview-2559269180
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/17678
mypy/checkexpr.pyhttps://github.com/python/mypy/pull/17678/files/da33c20467708623bff691bafffd3fd214a1144b#diff-42eda644ce5003e33ea0766d7601fcfb4934ad106429abfe115954a1fccddd07
Please reload this pagehttps://github.com/python/mypy/pull/17678
mypy/checker.pyhttps://github.com/python/mypy/pull/17678/files/da33c20467708623bff691bafffd3fd214a1144b#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
Please reload this pagehttps://github.com/python/mypy/pull/17678
sobolevnhttps://github.com/sobolevn
January 17, 2025 18:45https://github.com/python/mypy/pull/17678#commits-pushed-ddc8612
https://github.com/sobolevn
Merge branch 'master' into overloads-type-narrower-inferencehttps://github.com/python/mypy/pull/17678/commits/ddc861226cb4542e664009576fc509f2b4f9f0e1
ddc8612https://github.com/python/mypy/pull/17678/commits/ddc861226cb4542e664009576fc509f2b4f9f0e1
https://github.com/sobolevn
Address reviewhttps://github.com/python/mypy/pull/17678/commits/50377fab1b8dd0ca5805587d5054474bcfac0101
50377fahttps://github.com/python/mypy/pull/17678/commits/50377fab1b8dd0ca5805587d5054474bcfac0101
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
Jan 17, 2025https://github.com/python/mypy/pull/17678#issuecomment-2598650837
Please reload this pagehttps://github.com/python/mypy/pull/17678
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
Jan 17, 2025https://github.com/python/mypy/pull/17678#issuecomment-2598686714
mypy_primerhttps://github.com/hauntsaninja/mypy_primer
Please reload this pagehttps://github.com/python/mypy/pull/17678
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
Jan 20, 2025 https://github.com/python/mypy/pull/17678#pullrequestreview-2562878408
View reviewed changes https://github.com/python/mypy/pull/17678/files/50377fab1b8dd0ca5805587d5054474bcfac0101
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
Jan 20, 2025https://github.com/python/mypy/pull/17678#issuecomment-2602922471
Please reload this pagehttps://github.com/python/mypy/pull/17678
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
Jan 20, 2025https://github.com/python/mypy/pull/17678#issuecomment-2602974756
https://github.com/Gobot1234/steam.py/blob/d1f14354cec5dda30f3cb1fa28906eaf6dc81db4/steam/ext/commands/commands.py#L324https://github.com/Gobot1234/steam.py/blob/d1f14354cec5dda30f3cb1fa28906eaf6dc81db4/steam/ext/commands/commands.py#L324
Gobot1234/steam.py#597https://github.com/Gobot1234/steam.py/issues/597
@JukkaLhttps://github.com/JukkaL
Please reload this pagehttps://github.com/python/mypy/pull/17678
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
43ea203https://github.com/python/mypy/commit/43ea203e566901510dbdd59e8907fcddb2a8ee70
Jan 21, 2025https://github.com/python/mypy/pull/17678#event-16016345173
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
January 21, 2025 15:31https://github.com/python/mypy/pull/17678#event-16016345819
x612skmhttps://github.com/x612skm
Feb 24, 2025 https://github.com/python/mypy/pull/17678#ref-commit-d1ba235
https://github.com/sobolevn
https://github.com/x612skm
Infer correct types with overloads ofhttps://github.com/x612skm/mypy-dev/commit/d1ba235efd824a9103a8d3d549ba7ca1e0717ab0
Type[Guard | Is]https://github.com/x612skm/mypy-dev/commit/d1ba235efd824a9103a8d3d549ba7ca1e0717ab0
(https://github.com/x612skm/mypy-dev/commit/d1ba235efd824a9103a8d3d549ba7ca1e0717ab0
python#17678https://github.com/python/mypy/pull/17678
)https://github.com/x612skm/mypy-dev/commit/d1ba235efd824a9103a8d3d549ba7ca1e0717ab0
d1ba235https://github.com/x612skm/mypy-dev/commit/d1ba235efd824a9103a8d3d549ba7ca1e0717ab0
python#17579https://github.com/python/mypy/issues/17579
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
May 28, 2025 https://github.com/python/mypy/pull/17678#ref-issue-3087054619
[1.16 regression] narrowing on is_dataclass #19139 https://github.com/python/mypy/issues/19139
JukkaLhttps://github.com/JukkaL
May 28, 2025 https://github.com/python/mypy/pull/17678#ref-commit-e2ca0e9
https://github.com/JukkaL
Revert "Infer correct types with overloads ofhttps://github.com/python/mypy/commit/e2ca0e9ca0e5bbeeddd08622d0734270b14e2e38
Type[Guard | Is]https://github.com/python/mypy/commit/e2ca0e9ca0e5bbeeddd08622d0734270b14e2e38
(https://github.com/python/mypy/commit/e2ca0e9ca0e5bbeeddd08622d0734270b14e2e38
#17678https://github.com/python/mypy/pull/17678
e2ca0e9https://github.com/python/mypy/commit/e2ca0e9ca0e5bbeeddd08622d0734270b14e2e38
https://github.com/python/mypy/pull/17678
43ea203https://github.com/python/mypy/commit/43ea203e566901510dbdd59e8907fcddb2a8ee70
#19139https://github.com/python/mypy/issues/19139
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
May 28, 2025 https://github.com/python/mypy/pull/17678#ref-pullrequest-3097466908
Revert "Infer correct types with overloads of Type[Guard | Is] #19161 https://github.com/python/mypy/pull/19161
JukkaLhttps://github.com/JukkaL
May 29, 2025 https://github.com/python/mypy/pull/17678#ref-commit-c197d98
https://github.com/JukkaL
Revert "Infer correct types with overloads ofhttps://github.com/python/mypy/commit/c197d985fb32b645539a1767de96eff998285b95
Type[Guard | Is]https://github.com/python/mypy/commit/c197d985fb32b645539a1767de96eff998285b95
(https://github.com/python/mypy/commit/c197d985fb32b645539a1767de96eff998285b95
#19161https://github.com/python/mypy/pull/19161
c197d98https://github.com/python/mypy/commit/c197d985fb32b645539a1767de96eff998285b95
https://github.com/python/mypy/pull/19161
43ea203https://github.com/python/mypy/commit/43ea203e566901510dbdd59e8907fcddb2a8ee70
#17678https://github.com/python/mypy/pull/17678
#19139https://github.com/python/mypy/issues/19139
JukkaLhttps://github.com/JukkaL
May 29, 2025 https://github.com/python/mypy/pull/17678#ref-commit-2a036e7
https://github.com/JukkaL
Revert "Infer correct types with overloads ofhttps://github.com/python/mypy/commit/2a036e739f8691576056669371d9f020e95c2603
Type[Guard | Is]https://github.com/python/mypy/commit/2a036e739f8691576056669371d9f020e95c2603
(https://github.com/python/mypy/commit/2a036e739f8691576056669371d9f020e95c2603
#19161https://github.com/python/mypy/pull/19161
2a036e7https://github.com/python/mypy/commit/2a036e739f8691576056669371d9f020e95c2603
https://github.com/python/mypy/pull/19161
43ea203https://github.com/python/mypy/commit/43ea203e566901510dbdd59e8907fcddb2a8ee70
#17678https://github.com/python/mypy/pull/17678
#19139https://github.com/python/mypy/issues/19139
cdce8phttps://github.com/cdce8p
May 31, 2025 https://github.com/python/mypy/pull/17678#ref-commit-7024ea8
https://github.com/JukkaL
https://github.com/cdce8p
Revert "Infer correct types with overloads ofhttps://github.com/cdce8p/mypy/commit/7024ea868b11e929e28a74cbd6f060d3019e7c4a
Type[Guard | Is]https://github.com/cdce8p/mypy/commit/7024ea868b11e929e28a74cbd6f060d3019e7c4a
(https://github.com/cdce8p/mypy/commit/7024ea868b11e929e28a74cbd6f060d3019e7c4a
pyt…https://github.com/python/mypy/pull/19161
7024ea8https://github.com/cdce8p/mypy/commit/7024ea868b11e929e28a74cbd6f060d3019e7c4a
…hon#19161https://github.com/python/mypy/pull/19161
43ea203https://github.com/cdce8p/mypy/commit/43ea203e566901510dbdd59e8907fcddb2a8ee70
python#17678https://github.com/python/mypy/pull/17678
python#19139https://github.com/python/mypy/issues/19139
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%2F17678
https://github.com/JukkaL
JukkaL https://github.com/JukkaL
https://github.com/python/mypy/pull/17678/files/50377fab1b8dd0ca5805587d5054474bcfac0101
https://github.com/ilevkivskyi
ilevkivskyi https://github.com/ilevkivskyi
https://github.com/JelleZijlstra
JelleZijlstra https://github.com/JelleZijlstra
https://github.com/hauntsaninja
hauntsaninja https://github.com/hauntsaninja
Please reload this pagehttps://github.com/python/mypy/pull/17678
Overloads not resolved correctly when argument is Any and return types use TypeGuard or TypeIs https://github.com/python/mypy/issues/17579
Please reload this pagehttps://github.com/python/mypy/pull/17678
https://github.com/sobolevn
https://github.com/JukkaL
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.