René's URL Explorer Experiment


Title: Do not treat `match` value patterns as `isinstance` checks by sterliakov · Pull Request #20146 · python/mypy · GitHub

Open Graph Title: Do not treat `match` value patterns as `isinstance` checks by sterliakov · Pull Request #20146 · python/mypy

X Title: Do not treat `match` value patterns as `isinstance` checks by sterliakov · Pull Request #20146 · python/mypy

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

Open Graph Description: Fixes #20358. As discovered by @randolf-scholz in #20142, mypy treats value patterns in match statement in a completely wrong way. From PEP 622: Literal pattern uses equality with literal on the r...

X Description: Fixes #20358. As discovered by @randolf-scholz in #20142, mypy treats value patterns in match statement in a completely wrong way. From PEP 622: Literal pattern uses equality with literal on the r...

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

X: @github

direct link

Domain: github.com

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:7b635e2e-0b77-2bc6-0cc2-92224a3ccf52
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA50C:1B2BE:136B069:1C46D81:6A576B74
html-safe-noncec0125ec8b7c13912f763e0beb3b0f0d8f1bfc3b8b210898cf8d7de8c80c1b3da
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNTBDOjFCMkJFOjEzNkIwNjk6MUM0NkQ4MTo2QTU3NkI3NCIsInZpc2l0b3JfaWQiOiI3NjQ3OTA2Mjk5OTIyMzEyMDUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmaca068dc5363c188c9bfb8e00fd93091a7a6e6a44e70971d891c9142a526e4b6b1
hovercard-subject-tagpull_request:2963377685
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/20146/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/1bd7d55fb7c538141b10af89b442ebdc40b15e3423e4fe4efcd7f5ba5e14130d/python/mypy/pull/20146
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1bd7d55fb7c538141b10af89b442ebdc40b15e3423e4fe4efcd7f5ba5e14130d/python/mypy/pull/20146
og:image:altFixes #20358. As discovered by @randolf-scholz in #20142, mypy treats value patterns in match statement in a completely wrong way. From PEP 622: Literal pattern uses equality with literal on the r...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesterliakov
hostnamegithub.com
expected-hostnamegithub.com
None4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98
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
release1b5a9c55f39dd27607a574cdc272552f20236b44
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/mypy/pull/20146#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20146
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20146
Sign up https://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/20146
Reloadhttps://github.com/python/mypy/pull/20146
Reloadhttps://github.com/python/mypy/pull/20146
Please reload this pagehttps://github.com/python/mypy/pull/20146
python https://github.com/python
mypyhttps://github.com/python/mypy
Please reload this pagehttps://github.com/python/mypy/pull/20146
Notifications https://github.com/login?return_to=%2Fpython%2Fmypy
Fork 3.2k https://github.com/login?return_to=%2Fpython%2Fmypy
Star 20.5k https://github.com/login?return_to=%2Fpython%2Fmypy
Code https://github.com/python/mypy
Issues 2.7k https://github.com/python/mypy/issues
Pull requests 463 https://github.com/python/mypy/pulls
Actions https://github.com/python/mypy/actions
Projects https://github.com/python/mypy/projects
Wiki https://github.com/python/mypy/wiki
Security and quality 0 https://github.com/python/mypy/security
Insights https://github.com/python/mypy/pulse
Code https://github.com/python/mypy
Issues https://github.com/python/mypy/issues
Pull requests https://github.com/python/mypy/pulls
Actions https://github.com/python/mypy/actions
Projects https://github.com/python/mypy/projects
Wiki https://github.com/python/mypy/wiki
Security and quality https://github.com/python/mypy/security
Insights https://github.com/python/mypy/pulse
hauntsaninjahttps://github.com/hauntsaninja
python:masterhttps://github.com/python/mypy/tree/master
sterliakov:bugfix/match-value-patternhttps://github.com/sterliakov/mypy/tree/bugfix/match-value-pattern
Conversationhttps://github.com/python/mypy/pull/20146
Commits4 (4)https://github.com/python/mypy/pull/20146/commits
Checkshttps://github.com/python/mypy/pull/20146/checks
Files changedhttps://github.com/python/mypy/pull/20146/files
Do not treat match value patterns as isinstance checkshttps://github.com/python/mypy/pull/20146#top
hauntsaninjahttps://github.com/hauntsaninja
python:masterhttps://github.com/python/mypy/tree/master
sterliakov:bugfix/match-value-patternhttps://github.com/sterliakov/mypy/tree/bugfix/match-value-pattern
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
Oct 30, 2025https://github.com/python/mypy/pull/20146#issue-3570997746
Please reload this pagehttps://github.com/python/mypy/pull/20146
#20358https://github.com/python/mypy/issues/20358
@randolf-scholzhttps://github.com/randolf-scholz
#20142https://github.com/python/mypy/issues/20142
PEP 622https://peps.python.org/pep-0622/#literal-patterns
#10191https://github.com/python/mypy/pull/10191
Please reload this pagehttps://github.com/python/mypy/pull/20146
https://github.com/sterliakov
Do not treat value patterns as isinstance checkshttps://github.com/python/mypy/pull/20146/commits/67ded4ae66c9cbb9a427eea959d3c8bc57dac0af
67ded4ahttps://github.com/python/mypy/pull/20146/commits/67ded4ae66c9cbb9a427eea959d3c8bc57dac0af
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20146
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
Oct 30, 2025https://github.com/python/mypy/pull/20146#issuecomment-3468317891
@JukkaLhttps://github.com/JukkaL
@randolf-scholzhttps://github.com/randolf-scholz
Please reload this pagehttps://github.com/python/mypy/pull/20146
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
October 30, 2025 14:30https://github.com/python/mypy/pull/20146#event-20611029681
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
Oct 30, 2025https://github.com/python/mypy/pull/20146#issuecomment-3468337523
Please reload this pagehttps://github.com/python/mypy/pull/20146
https://github.com/randolf-scholz
randolf-scholzhttps://github.com/randolf-scholz
Oct 30, 2025https://github.com/python/mypy/pull/20146#issuecomment-3468427968
Please reload this pagehttps://github.com/python/mypy/pull/20146
Please reload this pagehttps://github.com/python/mypy/pull/20146
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
Oct 30, 2025https://github.com/python/mypy/pull/20146#issuecomment-3468478458
#19594https://github.com/python/mypy/pull/19594
Please reload this pagehttps://github.com/python/mypy/pull/20146
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
Oct 30, 2025 https://github.com/python/mypy/pull/20146#ref-issue-3571960993
Check #20146 sterliakov/mypy-issues#207 https://github.com/sterliakov/mypy-issues/issues/207
https://github.com/sterliakov
Add testcase suggested in review commentshttps://github.com/python/mypy/pull/20146/commits/a0289368395cd565d9b9623ab26a3a7e522a68e7
a028936https://github.com/python/mypy/pull/20146/commits/a0289368395cd565d9b9623ab26a3a7e522a68e7
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20146
https://github.com/A5rocks
A5rockshttps://github.com/A5rocks
Nov 16, 2025 https://github.com/python/mypy/pull/20146#pullrequestreview-3469684018
View reviewed changes https://github.com/python/mypy/pull/20146/files/a0289368395cd565d9b9623ab26a3a7e522a68e7
mypy/checker.pyhttps://github.com/python/mypy/pull/20146/files/a0289368395cd565d9b9623ab26a3a7e522a68e7#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
Please reload this pagehttps://github.com/python/mypy/pull/20146
test-data/unit/check-python310.testhttps://github.com/python/mypy/pull/20146/files/a0289368395cd565d9b9623ab26a3a7e522a68e7#diff-9100781e1e8bb8997aa611cce8014d8680677e036e9652d59fbd86336f80c3fe
Please reload this pagehttps://github.com/python/mypy/pull/20146
mypy/checkpattern.pyhttps://github.com/python/mypy/pull/20146/files/a0289368395cd565d9b9623ab26a3a7e522a68e7#diff-899f1e6b7a4d5a6697e7a47731ebcf92a1ce845b5f5fc0b70e3f7ebbef10d7c1
Please reload this pagehttps://github.com/python/mypy/pull/20146
https://github.com/sterliakov
Merge branch 'master' into bugfix/match-value-patternhttps://github.com/python/mypy/pull/20146/commits/f4a478bf2f6d7aa105720a9c07dd2bb0bec77566
f4a478bhttps://github.com/python/mypy/pull/20146/commits/f4a478bf2f6d7aa105720a9c07dd2bb0bec77566
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20146
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
Dec 3, 2025 https://github.com/python/mypy/pull/20146#ref-issue-3690612674
numpy dtype Statement is unreachable with mypy 1.19.0 #20358 https://github.com/python/mypy/issues/20358
https://github.com/sterliakov
Merge branch 'master' into bugfix/match-value-patternhttps://github.com/python/mypy/pull/20146/commits/443a3597b93431902b2a5197160e2258b6d38535
443a359https://github.com/python/mypy/pull/20146/commits/443a3597b93431902b2a5197160e2258b6d38535
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
Dec 3, 2025https://github.com/python/mypy/pull/20146#issuecomment-3607560437
mypy_primerhttps://github.com/hauntsaninja/mypy_primer
Please reload this pagehttps://github.com/python/mypy/pull/20146
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Dec 9, 2025 https://github.com/python/mypy/pull/20146#pullrequestreview-3557092846
View reviewed changes https://github.com/python/mypy/pull/20146/files/443a3597b93431902b2a5197160e2258b6d38535
test-data/unit/check-python310.testhttps://github.com/python/mypy/pull/20146/files/443a3597b93431902b2a5197160e2258b6d38535#diff-9100781e1e8bb8997aa611cce8014d8680677e036e9652d59fbd86336f80c3fe
ilevkivskyihttps://github.com/ilevkivskyi
Dec 9, 2025https://github.com/python/mypy/pull/20146#discussion_r2602384622
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/20146
sterliakovhttps://github.com/sterliakov
Dec 9, 2025https://github.com/python/mypy/pull/20146#discussion_r2603258317
Please reload this pagehttps://github.com/python/mypy/pull/20146
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/20146
sterliakovhttps://github.com/sterliakov
Dec 9, 2025https://github.com/python/mypy/pull/20146#discussion_r2603277970
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/20146
ilevkivskyihttps://github.com/ilevkivskyi
Dec 9, 2025https://github.com/python/mypy/pull/20146#discussion_r2603290834
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/20146
ilevkivskyihttps://github.com/ilevkivskyi
Dec 9, 2025https://github.com/python/mypy/pull/20146#discussion_r2603307592
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
@hauntsaninjahttps://github.com/hauntsaninja
#19159https://github.com/python/mypy/issues/19159
Please reload this pagehttps://github.com/python/mypy/pull/20146
randolf-scholzhttps://github.com/randolf-scholz
Dec 9, 2025https://github.com/python/mypy/pull/20146#discussion_r2603392143
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
#19159https://github.com/python/mypy/issues/19159
Please reload this pagehttps://github.com/python/mypy/pull/20146
ilevkivskyihttps://github.com/ilevkivskyi
Dec 9, 2025https://github.com/python/mypy/pull/20146#discussion_r2603410738
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
@hauntsaninjahttps://github.com/hauntsaninja
Please reload this pagehttps://github.com/python/mypy/pull/20146
sterliakovhttps://github.com/sterliakov
Dec 9, 2025https://github.com/python/mypy/pull/20146#discussion_r2603432185
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
@randolf-scholzhttps://github.com/randolf-scholz
#19159https://github.com/python/mypy/issues/19159
@ilevkivskyihttps://github.com/ilevkivskyi
Please reload this pagehttps://github.com/python/mypy/pull/20146
ilevkivskyihttps://github.com/ilevkivskyi
Dec 9, 2025https://github.com/python/mypy/pull/20146#discussion_r2603448389
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/20146
hauntsaninjahttps://github.com/hauntsaninja
Dec 11, 2025https://github.com/python/mypy/pull/20146#discussion_r2608931842
Please reload this pagehttps://github.com/python/mypy/pull/20146
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
#19159https://github.com/python/mypy/issues/19159
Please reload this pagehttps://github.com/python/mypy/pull/20146
https://github.com/RiyaPrabhakar-git
RiyaPrabhakar-githttps://github.com/RiyaPrabhakar-git
GC-Content-Calculatorhttps://github.com/users/RiyaPrabhakar-git/projects/1
Dec 12, 2025https://github.com/python/mypy/pull/20146#event-21527450923
https://github.com/apps/github-project-automation
github-project-automationhttps://github.com/apps/github-project-automation
GC-Content-Calculatorhttps://github.com/users/RiyaPrabhakar-git/projects/1
Dec 12, 2025https://github.com/python/mypy/pull/20146#event-21527451432
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
007d6dehttps://github.com/python/mypy/commit/007d6dea73abb258ff2db6d58b5f514c091476c4
Dec 14, 2025https://github.com/python/mypy/pull/20146#event-21547015205
Please reload this pagehttps://github.com/python/mypy/pull/20146
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
Dec 14, 2025 https://github.com/python/mypy/pull/20146#ref-issue-3095971907
[1.16 regression] failure to exhaustively narrow type var bounded by union with value pattern match #19159 https://github.com/python/mypy/issues/19159
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
Apr 9, 2026 https://github.com/python/mypy/pull/20146#ref-issue-4224998729
[1.20 regression] Type narrowing is order sensitive in match-case statement with narrowed enum type #21187 https://github.com/python/mypy/issues/21187
https://github.com/brianschubert
brianschuberthttps://github.com/brianschubert
Apr 28, 2026 https://github.com/python/mypy/pull/20146#ref-issue-4343049985
[1.20 regression] value pattern match statement narrowing broken for typevars with values #21356 https://github.com/python/mypy/issues/21356
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%2F20146
https://github.com/ilevkivskyi
ilevkivskyi https://github.com/ilevkivskyi
https://github.com/python/mypy/pull/20146/files/443a3597b93431902b2a5197160e2258b6d38535
https://github.com/hauntsaninja
hauntsaninja https://github.com/hauntsaninja
https://github.com/python/mypy/pull/20146/files/443a3597b93431902b2a5197160e2258b6d38535
https://github.com/randolf-scholz
randolf-scholz https://github.com/randolf-scholz
https://github.com/python/mypy/pull/20146/files/443a3597b93431902b2a5197160e2258b6d38535
https://github.com/A5rocks
A5rocks https://github.com/A5rocks
https://github.com/python/mypy/pull/20146/files/a0289368395cd565d9b9623ab26a3a7e522a68e7
numpy dtype Statement is unreachable with mypy 1.19.0 https://github.com/python/mypy/issues/20358
Please reload this pagehttps://github.com/python/mypy/pull/20146
https://github.com/sterliakov
https://github.com/randolf-scholz
https://github.com/ilevkivskyi
https://github.com/hauntsaninja
https://github.com/A5rocks
https://github.com/RiyaPrabhakar-git
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.