René's URL Explorer Experiment


Title: Fix negative narrowing of tuples in match statement by brianschubert · Pull Request #17817 · python/mypy · GitHub

Open Graph Title: Fix negative narrowing of tuples in match statement by brianschubert · Pull Request #17817 · python/mypy

X Title: Fix negative narrowing of tuples in match statement by brianschubert · Pull Request #17817 · python/mypy

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

Open Graph Description: Fixes #17328 Before Lines marked with !!! denote incorrect behavior. (Playground link) from typing import Literal m4: tuple[Literal[1], int] match m4: case (1, 5): reveal_type(m4) # N...

X Description: Fixes #17328 Before Lines marked with !!! denote incorrect behavior. (Playground link) from typing import Literal m4: tuple[Literal[1], int] match m4: case (1, 5): reveal_type(m4) # N...

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

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:3ae233a2-7d39-8d9b-5c27-e0ecd6feeb76
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD260:366F88:5C5165:84B6E1:6A577EA9
html-safe-nonce92e6b490a06a1c99009f1761d82d7e9dc8ddce63a9f49ba6e5e7925a5f8b7a15
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjYwOjM2NkY4ODo1QzUxNjU6ODRCNkUxOjZBNTc3RUE5IiwidmlzaXRvcl9pZCI6IjY0OTcyMTkwMjg3MTI5MTQ2MDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac2e8faa70ac55aabdfa1b51ef6da37ae2dece137b694548aeb10155ea27145f42
hovercard-subject-tagpull_request:2089753356
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/17817/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/d3ebf665b7e5c9e67c17ed2d1a8078a83f86c57cfa783b79790d265e05fa74b0/python/mypy/pull/17817
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d3ebf665b7e5c9e67c17ed2d1a8078a83f86c57cfa783b79790d265e05fa74b0/python/mypy/pull/17817
og:image:altFixes #17328 Before Lines marked with !!! denote incorrect behavior. (Playground link) from typing import Literal m4: tuple[Literal[1], int] match m4: case (1, 5): reveal_type(m4) # N...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebrianschubert
hostnamegithub.com
expected-hostnamegithub.com
Nonec6353e56e94423c9cd5abde7708a859afa36a0c1203c73749055bf6ee6704cd0
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
release9a9dfe2eff5c790a030f34cfcc89b4bf3ba08c7c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/mypy/pull/17817#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F17817
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%2F17817
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/17817
Reloadhttps://github.com/python/mypy/pull/17817
Reloadhttps://github.com/python/mypy/pull/17817
Please reload this pagehttps://github.com/python/mypy/pull/17817
python https://github.com/python
mypyhttps://github.com/python/mypy
Please reload this pagehttps://github.com/python/mypy/pull/17817
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
brianschubert:gh-17328-match-tuple-negative-narrowinghttps://github.com/brianschubert/mypy/tree/gh-17328-match-tuple-negative-narrowing
Conversationhttps://github.com/python/mypy/pull/17817
Commits1 (1)https://github.com/python/mypy/pull/17817/commits
Checkshttps://github.com/python/mypy/pull/17817/checks
Files changedhttps://github.com/python/mypy/pull/17817/files
Fix negative narrowing of tuples in match statementhttps://github.com/python/mypy/pull/17817#top
hauntsaninjahttps://github.com/hauntsaninja
python:masterhttps://github.com/python/mypy/tree/master
brianschubert:gh-17328-match-tuple-negative-narrowinghttps://github.com/brianschubert/mypy/tree/gh-17328-match-tuple-negative-narrowing
https://github.com/brianschubert
brianschuberthttps://github.com/brianschubert
Sep 24, 2024https://github.com/python/mypy/pull/17817#issue-2546143561
#17328https://github.com/python/mypy/issues/17328
Playground linkhttps://mypy-play.net/?mypy=1.11.2&python=3.12&flags=strict%2Cwarn-unreachable&gist=7a7081c5fbc2fac9987f24e02421f24f
Please reload this pagehttps://github.com/python/mypy/pull/17817
https://github.com/brianschubert
Fix negative narrowing of tuples in match statementhttps://github.com/python/mypy/pull/17817/commits/74bf2cc524a77115e6bf002a29065740a70e5c95
74bf2cchttps://github.com/python/mypy/pull/17817/commits/74bf2cc524a77115e6bf002a29065740a70e5c95
https://github.com/brianschubert
brianschuberthttps://github.com/brianschubert
Sep 24, 2024https://github.com/python/mypy/pull/17817#issuecomment-2372081577
mypy/mypy/checkpattern.pyhttps://github.com/python/mypy/blob/9ffb9ddf80fbf92956a55946c8f023fc09638959/mypy/checkpattern.py#L307-L314
9ffb9ddhttps://github.com/python/mypy/commit/9ffb9ddf80fbf92956a55946c8f023fc09638959
mypy/test-data/unit/check-python310.testhttps://github.com/python/mypy/blob/ecfab6a02415c46eda5717ec6ee9bfac8115c1e9/test-data/unit/check-python310.test#L1436-L1442
ecfab6ahttps://github.com/python/mypy/commit/ecfab6a02415c46eda5717ec6ee9bfac8115c1e9
mypy/mypy/checkpattern.pyhttps://github.com/python/mypy/blob/9ffb9ddf80fbf92956a55946c8f023fc09638959/mypy/checkpattern.py#L320-L322
9ffb9ddhttps://github.com/python/mypy/commit/9ffb9ddf80fbf92956a55946c8f023fc09638959
Please reload this pagehttps://github.com/python/mypy/pull/17817
https://github.com/brianschubert
brianschuberthttps://github.com/brianschubert
Sep 24, 2024https://github.com/python/mypy/pull/17817#issuecomment-2372082878
@freundTechhttps://github.com/freundTech
#10191https://github.com/python/mypy/pull/10191
Please reload this pagehttps://github.com/python/mypy/pull/17817
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
Sep 24, 2024https://github.com/python/mypy/pull/17817#issuecomment-2372232316
mypy_primerhttps://github.com/hauntsaninja/mypy_primer
Please reload this pagehttps://github.com/python/mypy/pull/17817
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
upnext https://github.com/python/mypy/issues?q=state%3Aopen%20label%3Aupnext
Sep 24, 2024https://github.com/python/mypy/pull/17817#event-14389235814
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
Sep 27, 2024 https://github.com/python/mypy/pull/17817#pullrequestreview-2332856369
View reviewed changes https://github.com/python/mypy/pull/17817/files/74bf2cc524a77115e6bf002a29065740a70e5c95
hauntsaninjahttps://github.com/hauntsaninja
https://github.com/python/mypy/pull/17817#pullrequestreview-2332856369
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/17817
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
1c01858https://github.com/python/mypy/commit/1c018589a621e38e4851a64f500a42ebe99ef21d
Sep 27, 2024https://github.com/python/mypy/pull/17817#event-14426118258
https://github.com/benclifford
bencliffordhttps://github.com/benclifford
Jan 8, 2025 https://github.com/python/mypy/pull/17817#ref-issue-2775460198
type narrowing vs assert vs unreachability changed in PR #17818 (between mypy 1.11 and 1.12) #18431 https://github.com/python/mypy/issues/18431
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%2F17817
https://github.com/hauntsaninja
hauntsaninja https://github.com/hauntsaninja
https://github.com/python/mypy/pull/17817/files/74bf2cc524a77115e6bf002a29065740a70e5c95
upnext https://github.com/python/mypy/issues?q=state%3Aopen%20label%3Aupnext
False positive: unreachable case when using Literal https://github.com/python/mypy/issues/17328
Please reload this pagehttps://github.com/python/mypy/pull/17817
https://github.com/brianschubert
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.