René's URL Explorer Experiment


Title: Fixes type narrowing for overlaping runtime types by sobolevn · Pull Request #11273 · python/mypy · GitHub

Open Graph Title: Fixes type narrowing for overlaping runtime types by sobolevn · Pull Request #11273 · python/mypy

X Title: Fixes type narrowing for overlaping runtime types by sobolevn · Pull Request #11273 · python/mypy

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

Open Graph Description: As always, fixing issues with type narrowing / inference is always very hard, because small changes can backfire. But, this looks as a simple change. Let's see how tests will behave. Closes #11272

X Description: As always, fixing issues with type narrowing / inference is always very hard, because small changes can backfire. But, this looks as a simple change. Let's see how tests will behave. Closes #11272

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

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:31b5b132-8f53-2454-9924-087ff17a8856
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8DC2:3F7C2E:27F49:38100:6B004FB7
html-safe-nonce80a58a626a419ff99520dab38a0a8df1fe79dcb42f887219695208d718a69f9b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REMyOjNGN0MyRToyN0Y0OTozODEwMDo2QjAwNEZCNyIsInZpc2l0b3JfaWQiOiI3MjgyMzk5NTM2NDU3MjA3NzM1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac48ede39d9741e45f404dc824c73d001192bfcb9d435abea439590bf884cdeddb
hovercard-subject-tagpull_request:750265778
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/11273/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/cc765b448109ad21bf0dfe02034b2303590576014853f1f6d28287fede62e013/python/mypy/pull/11273
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/cc765b448109ad21bf0dfe02034b2303590576014853f1f6d28287fede62e013/python/mypy/pull/11273
og:image:altAs always, fixing issues with type narrowing / inference is always very hard, because small changes can backfire. But, this looks as a simple change. Let's see how tests will behave. Closes #11272
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesobolevn
hostnamegithub.com
expected-hostnamegithub.com
Nonef420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb
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
release26e00df917aba0f128135dc073ea0c5e33a70d40
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/python/mypy/pull/11273#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F11273
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%2F11273
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/11273
Reloadhttps://github.com/python/mypy/pull/11273
Reloadhttps://github.com/python/mypy/pull/11273
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 requests546 (546)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
hauntsaninjahttps://github.com/hauntsaninja
python:masterhttps://github.com/python/mypy/tree/master
Conversationhttps://github.com/python/mypy/pull/11273
Commits3 (3)https://github.com/python/mypy/pull/11273/commits
Checkshttps://github.com/python/mypy/pull/11273/checks
Files changedhttps://github.com/python/mypy/pull/11273/files
Fixes type narrowing for overlaping runtime typeshttps://github.com/python/mypy/pull/11273#top
hauntsaninjahttps://github.com/hauntsaninja
python:masterhttps://github.com/python/mypy/tree/master
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
Oct 5, 2021https://github.com/python/mypy/pull/11273#issue-1016795556
#11272https://github.com/python/mypy/issues/11272
Please reload this pagehttps://github.com/python/mypy/pull/11273
sobolevnhttps://github.com/sobolevn
October 5, 2021 23:28https://github.com/python/mypy/pull/11273#commits-pushed-e127ada
https://github.com/sobolevn
Fixes type narrowing for overlaping runtime types, refshttps://github.com/python/mypy/pull/11273/commits/e127ada8c428d62d8d2a60fa85a6743351ab3b63
#11272https://github.com/python/mypy/issues/11272
e127adahttps://github.com/python/mypy/pull/11273/commits/e127ada8c428d62d8d2a60fa85a6743351ab3b63
https://github.com/sobolevn
Fixes type narrowing for overlaping runtime types, refshttps://github.com/python/mypy/pull/11273/commits/0ee45823f88b82fbb4e13d3c8ed8e40c58096167
#11272https://github.com/python/mypy/issues/11272
0ee4582https://github.com/python/mypy/pull/11273/commits/0ee45823f88b82fbb4e13d3c8ed8e40c58096167
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F11273
https://github.com/sobolevn
Typo fixedhttps://github.com/python/mypy/pull/11273/commits/f99462af00b0b6c177a47c01156d1cad381dc291
f99462ahttps://github.com/python/mypy/pull/11273/commits/f99462af00b0b6c177a47c01156d1cad381dc291
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
Oct 5, 2021https://github.com/python/mypy/pull/11273#issuecomment-934835609
Please reload this pagehttps://github.com/python/mypy/pull/11273
Please reload this pagehttps://github.com/python/mypy/pull/11273
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
Oct 5, 2021https://github.com/python/mypy/pull/11273#issuecomment-934838074
mypy_primerhttps://github.com/hauntsaninja/mypy_primer
Please reload this pagehttps://github.com/python/mypy/pull/11273
Adds assert_never helper pydantic/pydantic#3294 https://github.com/pydantic/pydantic/pull/3294
Annotates indexers/utils.py functions that don't return anything with None pandas-dev/pandas#43893 https://github.com/pandas-dev/pandas/pull/43893
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
Oct 10, 2021 https://github.com/python/mypy/pull/11273#pullrequestreview-775641883
View reviewed changes https://github.com/python/mypy/pull/11273/files/f99462af00b0b6c177a47c01156d1cad381dc291
hauntsaninjahttps://github.com/hauntsaninja
https://github.com/python/mypy/pull/11273#pullrequestreview-775641883
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/11273
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
f4a21a4https://github.com/python/mypy/commit/f4a21a4010405a3e98d0345de6c8f7ca955ce892
Oct 31, 2021https://github.com/python/mypy/pull/11273#event-5545708080
https://github.com/freundTech
freundTechhttps://github.com/freundTech
Dec 14, 2021 https://github.com/python/mypy/pull/11273#ref-pullrequest-826742589
Support for python 3.10 match statement #10191 https://github.com/python/mypy/pull/10191
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
Jan 6, 2022 https://github.com/python/mypy/pull/11273#ref-issue-1094706801
INTERNAL ERROR RuntimeError in visit_erased_type with mypy 0.930 #11913 https://github.com/python/mypy/issues/11913
https://github.com/sobolevn
sobolevnhttps://github.com/sobolevn
Jan 6, 2022 https://github.com/python/mypy/pull/11273#ref-pullrequest-1095444180
Fix crash on ErasedType and covers_at_runtime #11924 https://github.com/python/mypy/pull/11924
JukkaLhttps://github.com/JukkaL
Jan 7, 2022 https://github.com/python/mypy/pull/11273#ref-commit-a0f27b1
https://github.com/sobolevn
https://github.com/hauntsaninja
Fix crash onhttps://github.com/python/mypy/commit/a0f27b1d1f21bc6c7502374c3a1e2b642758a4bb
ErasedTypehttps://github.com/python/mypy/commit/a0f27b1d1f21bc6c7502374c3a1e2b642758a4bb
andhttps://github.com/python/mypy/commit/a0f27b1d1f21bc6c7502374c3a1e2b642758a4bb
covers_at_runtimehttps://github.com/python/mypy/commit/a0f27b1d1f21bc6c7502374c3a1e2b642758a4bb
(https://github.com/python/mypy/commit/a0f27b1d1f21bc6c7502374c3a1e2b642758a4bb
#11924https://github.com/python/mypy/pull/11924
)https://github.com/python/mypy/commit/a0f27b1d1f21bc6c7502374c3a1e2b642758a4bb
a0f27b1https://github.com/python/mypy/commit/a0f27b1d1f21bc6c7502374c3a1e2b642758a4bb
#11913https://github.com/python/mypy/issues/11913
#11273https://github.com/python/mypy/pull/11273
JukkaLhttps://github.com/JukkaL
Jan 7, 2022 https://github.com/python/mypy/pull/11273#ref-commit-5b3280e
https://github.com/sobolevn
https://github.com/hauntsaninja
https://github.com/JukkaL
Fix crash onhttps://github.com/python/mypy/commit/5b3280e667aea60c4a22b3e1df4fad6c5df421bd
ErasedTypehttps://github.com/python/mypy/commit/5b3280e667aea60c4a22b3e1df4fad6c5df421bd
andhttps://github.com/python/mypy/commit/5b3280e667aea60c4a22b3e1df4fad6c5df421bd
covers_at_runtimehttps://github.com/python/mypy/commit/5b3280e667aea60c4a22b3e1df4fad6c5df421bd
(https://github.com/python/mypy/commit/5b3280e667aea60c4a22b3e1df4fad6c5df421bd
#11924https://github.com/python/mypy/pull/11924
)https://github.com/python/mypy/commit/5b3280e667aea60c4a22b3e1df4fad6c5df421bd
5b3280ehttps://github.com/python/mypy/commit/5b3280e667aea60c4a22b3e1df4fad6c5df421bd
#11913https://github.com/python/mypy/issues/11913
#11273https://github.com/python/mypy/pull/11273
tushar-deepsourcehttps://github.com/tushar-deepsource
Jan 20, 2022 https://github.com/python/mypy/pull/11273#ref-commit-d8e7cd5
https://github.com/sobolevn
https://github.com/tushar-deepsource
Fixes type narrowing for overlaping runtime types (https://github.com/DeepSourceCorp/mypy/commit/d8e7cd56b9b0e3cbcfdefdd5aa9621020119f1ed
python#11273https://github.com/python/mypy/pull/11273
)https://github.com/DeepSourceCorp/mypy/commit/d8e7cd56b9b0e3cbcfdefdd5aa9621020119f1ed
d8e7cd5https://github.com/DeepSourceCorp/mypy/commit/d8e7cd56b9b0e3cbcfdefdd5aa9621020119f1ed
python#11272https://github.com/python/mypy/issues/11272
tushar-deepsourcehttps://github.com/tushar-deepsource
Jan 20, 2022 https://github.com/python/mypy/pull/11273#ref-commit-4d972cf
https://github.com/sobolevn
https://github.com/hauntsaninja
https://github.com/tushar-deepsource
Fix crash onhttps://github.com/DeepSourceCorp/mypy/commit/4d972cf5bf33118f11f977b39de81e5d13909fe0
ErasedTypehttps://github.com/DeepSourceCorp/mypy/commit/4d972cf5bf33118f11f977b39de81e5d13909fe0
andhttps://github.com/DeepSourceCorp/mypy/commit/4d972cf5bf33118f11f977b39de81e5d13909fe0
covers_at_runtimehttps://github.com/DeepSourceCorp/mypy/commit/4d972cf5bf33118f11f977b39de81e5d13909fe0
(https://github.com/DeepSourceCorp/mypy/commit/4d972cf5bf33118f11f977b39de81e5d13909fe0
python#11924https://github.com/python/mypy/pull/11924
)https://github.com/DeepSourceCorp/mypy/commit/4d972cf5bf33118f11f977b39de81e5d13909fe0
4d972cfhttps://github.com/DeepSourceCorp/mypy/commit/4d972cf5bf33118f11f977b39de81e5d13909fe0
python#11913https://github.com/python/mypy/issues/11913
python#11273https://github.com/python/mypy/pull/11273
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
Aug 12, 2023 https://github.com/python/mypy/pull/11273#ref-issue-823891459
Narrowing depends on the order of isinstance checks when using a genric type #10178 https://github.com/python/mypy/issues/10178
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%2F11273
https://github.com/hauntsaninja
hauntsaninja https://github.com/hauntsaninja
https://github.com/python/mypy/pull/11273/files/f99462af00b0b6c177a47c01156d1cad381dc291
Please reload this pagehttps://github.com/python/mypy/pull/11273
Type narrowing of a union type works incorrectly in presence of a list https://github.com/python/mypy/issues/11272
Please reload this pagehttps://github.com/python/mypy/pull/11273
https://github.com/sobolevn
https://github.com/hauntsaninja
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.