| route-pattern | /_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format) |
| route-controller | voltron_pull_requests_fragments |
| route-action | pull_request_layout |
| fetch-nonce | v2:173f7ef2-bb30-4689-b8bb-b55f6d0172c9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C7D0:28017F:505894:6AA099:6A58029C |
| html-safe-nonce | f0ad21b0c372e1e1fbb4e4a7e9a8e051b3f026fdf279b8e9aa51c84f63e1ec92 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0QwOjI4MDE3Rjo1MDU4OTQ6NkFBMDk5OjZBNTgwMjlDIiwidmlzaXRvcl9pZCI6IjkwMzk0NTk4ODk3NTY3NjY4NzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | dd1bf6f24ae0451d3fc08f1c1d1431663739d3ce63e46b9e7b3f9bc528601adf |
| hovercard-subject-tag | pull_request:3249034302 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///voltron/pull_requests_fragments/pull_request_layout |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/python/mypy/20744/pull_request_layout |
| twitter:image | https://opengraph.githubassets.com/a717518a0ba53a773b34b0973743589be89d0e9e18ff4a6d98ad1a999e8c2d20/python/mypy/pull/20744 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a717518a0ba53a773b34b0973743589be89d0e9e18ff4a6d98ad1a999e8c2d20/python/mypy/pull/20744 |
| og:image:alt | I realised there is a simpler and more complete approach than the one taken in #19600.
This adds the new "Step 2" to the original code. Best way to review the diff is probably to check it... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hauntsaninja |
| hostname | github.com |
| expected-hostname | github.com |
| None | 49c8c15fabcbf356d607a90ca115c13b273e42ff8b74155de050fd229a9b0121 |
| turbo-cache-control | no-cache |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3fb1f684e7a833eb1b2d01d39875a2b52cb4fe9b |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/python/mypy/pull/20744#start-of-content |
|
| https://github.com/ |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20744 |
| GitHub CopilotWrite better code with AI | https://github.com/features/copilot |
| GitHub Copilot appDirect agents from issue to merge | https://github.com/features/ai/github-app |
| MCP RegistryNewIntegrate external tools | https://github.com/mcp |
| ActionsAutomate any workflow | https://github.com/features/actions |
| CodespacesInstant dev environments | https://github.com/features/codespaces |
| IssuesPlan and track work | https://github.com/features/issues |
| Code ReviewManage code changes | https://github.com/features/code-review |
| GitHub Advanced SecurityFind and fix vulnerabilities | https://github.com/security/advanced-security |
| Code securitySecure your code as you build | https://github.com/security/advanced-security/code-security |
| Secret protectionStop leaks before they start | https://github.com/security/advanced-security/secret-protection |
| Why GitHub | https://github.com/why-github |
| Documentation | https://docs.github.com |
| Blog | https://github.blog |
| Changelog | https://github.blog/changelog |
| Marketplace | https://github.com/marketplace |
| View all features | https://github.com/features |
| Enterprises | https://github.com/enterprise |
| Small and medium teams | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| App Modernization | https://github.com/solutions/use-case/app-modernization |
| DevSecOps | https://github.com/solutions/use-case/devsecops |
| DevOps | https://github.com/solutions/use-case/devops |
| CI/CD | https://github.com/solutions/use-case/ci-cd |
| View all use cases | https://github.com/solutions/use-case |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| View all industries | https://github.com/solutions/industry |
| View all solutions | https://github.com/solutions |
| AI | https://github.com/resources/articles?topic=ai |
| Software Development | https://github.com/resources/articles?topic=software-development |
| DevOps | https://github.com/resources/articles?topic=devops |
| Security | https://github.com/resources/articles?topic=security |
| View all topics | https://github.com/resources/articles |
| Customer stories | https://github.com/customer-stories |
| Events & webinars | https://github.com/resources/events |
| Ebooks & reports | https://github.com/resources/whitepapers |
| Business insights | https://github.com/solutions/executive-insights |
| GitHub Skills | https://skills.github.com |
| Documentation | https://docs.github.com |
| Customer support | https://support.github.com |
| Community forum | https://github.com/orgs/community/discussions |
| Trust center | https://github.com/trust-center |
| Partners | https://github.com/partners |
| View all resources | https://github.com/resources |
| GitHub SponsorsFund open source developers | https://github.com/open-source/sponsors |
| Security Lab | https://securitylab.github.com |
| Maintainer Community | https://maintainers.github.com |
| Accelerator | https://github.com/open-source/accelerator |
| GitHub Stars | https://stars.github.com |
| Archive Program | https://archiveprogram.github.com |
| Topics | https://github.com/topics |
| Trending | https://github.com/trending |
| Collections | https://github.com/collections |
| Enterprise platformAI-powered developer platform | https://github.com/enterprise |
| GitHub Advanced SecurityEnterprise-grade security features | https://github.com/security/advanced-security |
| Copilot for BusinessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Pricing | https://github.com/pricing |
| Search syntax tips | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
| documentation | https://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%2F20744 |
|
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 |
| Reload | https://github.com/python/mypy/pull/20744 |
| Reload | https://github.com/python/mypy/pull/20744 |
| Reload | https://github.com/python/mypy/pull/20744 |
| Please reload this page | https://github.com/python/mypy/pull/20744 |
|
python
| https://github.com/python |
| mypy | https://github.com/python/mypy |
| Please reload this page | https://github.com/python/mypy/pull/20744 |
|
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
465
| 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 |
| hauntsaninja | https://github.com/hauntsaninja |
| python:master | https://github.com/python/mypy/tree/master |
| hauntsaninja:matchtup | https://github.com/hauntsaninja/mypy/tree/matchtup |
| Conversation | https://github.com/python/mypy/pull/20744 |
| Commits3 (3) | https://github.com/python/mypy/pull/20744/commits |
| Checks | https://github.com/python/mypy/pull/20744/checks |
| Files changed | https://github.com/python/mypy/pull/20744/files |
| Further improve match statement narrowing against unions | https://github.com/python/mypy/pull/20744#top |
| hauntsaninja | https://github.com/hauntsaninja |
| python:master | https://github.com/python/mypy/tree/master |
| hauntsaninja:matchtup | https://github.com/hauntsaninja/mypy/tree/matchtup |
|
| https://github.com/hauntsaninja |
| hauntsaninja | https://github.com/hauntsaninja |
| Feb 5, 2026 | https://github.com/python/mypy/pull/20744#issue-3900233979 |
| Please reload this page | https://github.com/python/mypy/pull/20744 |
| #19600 | https://github.com/python/mypy/pull/19600 |
| #19600 | https://github.com/python/mypy/pull/19600 |
| #15190 | https://github.com/python/mypy/issues/15190 |
| #17549 | https://github.com/python/mypy/issues/17549 |
| #17600 | https://github.com/python/mypy/pull/17600 |
| #18039 | https://github.com/python/mypy/issues/18039 |
| #19081 | https://github.com/python/mypy/issues/19081 |
| Please reload this page | https://github.com/python/mypy/pull/20744 |
|
| https://github.com/hauntsaninja |
| Further improve match statement narrowing against unions | https://github.com/python/mypy/pull/20744/commits/d2dd89efe5660f04a1416e9a03404197b055a199 |
| d2dd89e | https://github.com/python/mypy/pull/20744/commits/d2dd89efe5660f04a1416e9a03404197b055a199 |
| python#19600 | https://github.com/python/mypy/pull/19600 |
| https://github.com/apps/github-actions |
| Sign in to view | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20744 |
| https://github.com/hauntsaninja |
| hauntsaninja | https://github.com/hauntsaninja |
| February 5, 2026 08:24 | https://github.com/python/mypy/pull/20744#event-22551263789 |
|
| https://github.com/hauntsaninja |
| another test | https://github.com/python/mypy/pull/20744/commits/7bba46d5859d168e74903ccde665166b7d3bc6d7 |
| 7bba46d | https://github.com/python/mypy/pull/20744/commits/7bba46d5859d168e74903ccde665166b7d3bc6d7 |
| https://github.com/apps/github-actions |
| github-actions | https://github.com/apps/github-actions |
|
Feb 5, 2026
| https://github.com/python/mypy/pull/20744#ref-issue-3903627137 |
|
Check #20744
sterliakov/mypy-issues#265
| https://github.com/sterliakov/mypy-issues/issues/265 |
| https://github.com/hauntsaninja |
| hauntsaninja | https://github.com/hauntsaninja |
|
Feb 5, 2026
| https://github.com/python/mypy/pull/20744#ref-issue-2613584095 |
|
Can't infer tuple inside match case
#18039
| https://github.com/python/mypy/issues/18039 |
| https://github.com/apps/github-actions |
| Sign in to view | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20744 |
| https://github.com/hauntsaninja |
| hauntsaninja | https://github.com/hauntsaninja |
| February 5, 2026 21:40 | https://github.com/python/mypy/pull/20744#event-22571957017 |
| https://github.com/hauntsaninja |
| hauntsaninja | https://github.com/hauntsaninja |
|
Feb 5, 2026
| https://github.com/python/mypy/pull/20744#ref-issue-3802163929 |
|
Better narrowing
#20564
| https://github.com/python/mypy/issues/20564 |
| https://github.com/hauntsaninja |
| hauntsaninja | https://github.com/hauntsaninja |
| JukkaL | https://github.com/JukkaL |
| February 5, 2026 22:58 | https://github.com/python/mypy/pull/20744#event-22573480938 |
| https://github.com/JukkaL |
| JukkaL | https://github.com/JukkaL |
|
Feb 11, 2026
| https://github.com/python/mypy/pull/20744#pullrequestreview-3785863746 |
|
View reviewed changes
| https://github.com/python/mypy/pull/20744/files/7bba46d5859d168e74903ccde665166b7d3bc6d7 |
| JukkaL | https://github.com/JukkaL |
| https://github.com/python/mypy/pull/20744#pullrequestreview-3785863746 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://github.com/python/mypy/pull/20744 |
| mypy/checkpattern.py | https://github.com/python/mypy/pull/20744/files/7bba46d5859d168e74903ccde665166b7d3bc6d7#diff-899f1e6b7a4d5a6697e7a47731ebcf92a1ce845b5f5fc0b70e3f7ebbef10d7c1 |
| JukkaL | https://github.com/JukkaL |
| Feb 11, 2026 | https://github.com/python/mypy/pull/20744#discussion_r2794223423 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://github.com/python/mypy/pull/20744 |
|
| https://github.com/hauntsaninja |
| . | https://github.com/python/mypy/pull/20744/commits/dd0b249e046e6c581c9ab84afb91d112c696bcd4 |
| dd0b249 | https://github.com/python/mypy/pull/20744/commits/dd0b249e046e6c581c9ab84afb91d112c696bcd4 |
| https://github.com/apps/github-actions |
| github-actions | https://github.com/apps/github-actions |
| Feb 11, 2026 | https://github.com/python/mypy/pull/20744#issuecomment-3886533617 |
| mypy_primer | https://github.com/hauntsaninja/mypy_primer |
| Please reload this page | https://github.com/python/mypy/pull/20744 |
| https://github.com/hauntsaninja |
| hauntsaninja | https://github.com/hauntsaninja |
| 9752e19 | https://github.com/python/mypy/commit/9752e1968e9224d2ead4f0cdfd5ff3791ab21b35 |
| Feb 11, 2026 | https://github.com/python/mypy/pull/20744#event-22714397610 |
| Please reload this page | https://github.com/python/mypy/pull/20744 |
| https://github.com/hauntsaninja |
| hauntsaninja | https://github.com/hauntsaninja |
| February 11, 2026 19:39 | https://github.com/python/mypy/pull/20744#event-22714398460 |
|
Mypy doesn't narrow a matched object's type (generic or not) based on attribute subpattern match
#19081
| https://github.com/python/mypy/issues/19081 |
|
Better match narrowing for irrefutable mapping patterns
#20906
| https://github.com/python/mypy/pull/20906 |
| hauntsaninja | https://github.com/hauntsaninja |
|
Mar 4, 2026
| https://github.com/python/mypy/pull/20744#ref-commit-e413220 |
|
| https://github.com/hauntsaninja |
| Better match narrowing for irrefutable mapping patterns ( | https://github.com/python/mypy/commit/e413220e0e9027c6bfd1551d12e65df7b1740948 |
| #20906 | https://github.com/python/mypy/pull/20906 |
| ) | https://github.com/python/mypy/commit/e413220e0e9027c6bfd1551d12e65df7b1740948 |
| e413220 | https://github.com/python/mypy/commit/e413220e0e9027c6bfd1551d12e65df7b1740948 |
| #18950 | https://github.com/python/mypy/issues/18950 |
| #19081 (comment) | https://github.com/python/mypy/issues/19081#issuecomment-2920053885 |
| #20744 | https://github.com/python/mypy/pull/20744 |
| #20782 | https://github.com/python/mypy/pull/20782 |
| https://github.co/hiddenchars |
| https://github.com/python/mypy/pull/{{ revealButtonHref }} |
| Sign up for free | https://github.com/join?source=comment-repo |
| Sign in to comment | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F20744 |
|
| https://github.com/JukkaL |
|
JukkaL
| https://github.com/JukkaL |
|
| https://github.com/python/mypy/pull/20744/files/7bba46d5859d168e74903ccde665166b7d3bc6d7 |
|
Can't infer tuple inside match case
| https://github.com/python/mypy/issues/18039 |
|
Type is not being narrowed properly in match statement
| https://github.com/python/mypy/issues/17549 |
|
Unable to narrow the type of a tagged union when using a match statement
| https://github.com/python/mypy/issues/15190 |
| Please reload this page | https://github.com/python/mypy/pull/20744 |
|
| https://github.com/hauntsaninja |
|
| https://github.com/JukkaL |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |