| 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:b123e45f-2527-ff89-ee62-a32fcc6df360 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A5B4:4B803:2225392:2DBD7C1:6A599335 |
| html-safe-nonce | cdd3cad6b03e3adc2f9fc28ceb5b67b208d29fd819ac0df0fd40884ad32775c0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUI0OjRCODAzOjIyMjUzOTI6MkRCRDdDMTo2QTU5OTMzNSIsInZpc2l0b3JfaWQiOiI0ODE3ODUyMzc0NjM0MzA0MzA5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 30c7754e9ee5f60c711ce14fff1630323a5f878f703e13999157b7c4896ee507 |
| hovercard-subject-tag | pull_request:1909936461 |
| 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/17344/pull_request_layout |
| twitter:image | https://opengraph.githubassets.com/aef6a8f5ff3177141742ac0e7beee51bdd88d957c2e3bba359067e70ba348374/python/mypy/pull/17344 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aef6a8f5ff3177141742ac0e7beee51bdd88d957c2e3bba359067e70ba348374/python/mypy/pull/17344 |
| og:image:alt | Enables the narrowing of variable types when checking a variable is "in" a collection, and the collection type is a subtype of the variable type.
Fixes #3229
(Explain how this PR changes ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Jordandev678 |
| hostname | github.com |
| expected-hostname | github.com |
| None | a540949572872b935b393b36db38922db390ae71c859537d741b8f3eb7e545b5 |
| 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 | 624bb50a7497aa346bef8cc3743af408a9ea10ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/python/mypy/pull/17344#start-of-content |
|
| https://github.com/ |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F17344 |
| 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%2F17344 |
|
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/17344 |
| Reload | https://github.com/python/mypy/pull/17344 |
| Reload | https://github.com/python/mypy/pull/17344 |
| Please reload this page | https://github.com/python/mypy/pull/17344 |
|
python
| https://github.com/python |
| mypy | https://github.com/python/mypy |
| Please reload this page | https://github.com/python/mypy/pull/17344 |
|
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
466
| 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 |
| Jordandev678:innarrowing | https://github.com/Jordandev678/mypy/tree/innarrowing |
| Conversation | https://github.com/python/mypy/pull/17344 |
| Commits7 (7) | https://github.com/python/mypy/pull/17344/commits |
| Checks | https://github.com/python/mypy/pull/17344/checks |
| Files changed | https://github.com/python/mypy/pull/17344/files |
| Enables the narrowing of variable types when checking a variable is "in" a collection. | https://github.com/python/mypy/pull/17344#top |
| hauntsaninja | https://github.com/hauntsaninja |
| python:master | https://github.com/python/mypy/tree/master |
| Jordandev678:innarrowing | https://github.com/Jordandev678/mypy/tree/innarrowing |
|
| https://github.com/Jordandev678 |
| Jordandev678 | https://github.com/Jordandev678 |
| Jun 7, 2024 | https://github.com/python/mypy/pull/17344#issue-2341247542 |
| #3229 | https://github.com/python/mypy/issues/3229 |
| Please reload this page | https://github.com/python/mypy/pull/17344 |
| Jordandev678 | https://github.com/Jordandev678 |
| June 7, 2024 19:32 | https://github.com/python/mypy/pull/17344#commits-pushed-fd85e87 |
|
| https://github.com/Jordandev678 |
| Enable narrowing types using the "in" operator | https://github.com/python/mypy/pull/17344/commits/fd85e8753eeb6906c2dbfcfb9d627e02abbfe912 |
| fd85e87 | https://github.com/python/mypy/pull/17344/commits/fd85e8753eeb6906c2dbfcfb9d627e02abbfe912 |
|
| https://github.com/Jordandev678 |
| Add test case from | https://github.com/python/mypy/pull/17344/commits/3783f1d07d253425b4d8090e56656688433a696b |
| python#3229 | https://github.com/python/mypy/issues/3229 |
| 3783f1d | https://github.com/python/mypy/pull/17344/commits/3783f1d07d253425b4d8090e56656688433a696b |
|
| https://github.com/Jordandev678 |
| Add list to narrowing.pyi for testTypeNarrowingStringInList | https://github.com/python/mypy/pull/17344/commits/dae707d92357c13fef85af49796d341cfbbaabc8 |
| dae707d | https://github.com/python/mypy/pull/17344/commits/dae707d92357c13fef85af49796d341cfbbaabc8 |
|
| https://github.com/marketplace/pre-commit-ci |
| [pre-commit.ci] auto fixes from pre-commit.com hooks | https://github.com/python/mypy/pull/17344/commits/0c10969283124465e9c3a50d8f0ef8a68e4502fe |
| 0c10969 | https://github.com/python/mypy/pull/17344/commits/0c10969283124465e9c3a50d8f0ef8a68e4502fe |
| https://pre-commit.ci | https://pre-commit.ci |
| https://github.com/apps/github-actions |
| Sign in to view | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F17344 |
| Jordandev678 | https://github.com/Jordandev678 |
| June 8, 2024 09:40 | https://github.com/python/mypy/pull/17344#commits-pushed-800741a |
|
| https://github.com/Jordandev678 |
| Don't update if_map if item_type == collection_item_type | https://github.com/python/mypy/pull/17344/commits/800741a38f10c10dda98cac3b3f1de477bcf1cfd |
| 800741a | https://github.com/python/mypy/pull/17344/commits/800741a38f10c10dda98cac3b3f1de477bcf1cfd |
|
| https://github.com/Jordandev678 |
| Merge branch 'master' into innarrowing | https://github.com/python/mypy/pull/17344/commits/8c86ce14da2dacc63084e3b904ccc1ee9dd490a7 |
| 8c86ce1 | https://github.com/python/mypy/pull/17344/commits/8c86ce14da2dacc63084e3b904ccc1ee9dd490a7 |
|
| https://github.com/marketplace/pre-commit-ci |
| [pre-commit.ci] auto fixes from pre-commit.com hooks | https://github.com/python/mypy/pull/17344/commits/0bb56898805e16a7e00cc483eefa5250f289ef5d |
| 0bb5689 | https://github.com/python/mypy/pull/17344/commits/0bb56898805e16a7e00cc483eefa5250f289ef5d |
| https://pre-commit.ci | https://pre-commit.ci |
| https://github.com/apps/github-actions |
| github-actions | https://github.com/apps/github-actions |
| Jun 8, 2024 | https://github.com/python/mypy/pull/17344#issuecomment-2156001365 |
| mypy_primer | https://github.com/hauntsaninja/mypy_primer |
| Please reload this page | https://github.com/python/mypy/pull/17344 |
| https://github.com/Jordandev678 |
| Jordandev678 | https://github.com/Jordandev678 |
| Jun 8, 2024 | https://github.com/python/mypy/pull/17344#issuecomment-2156135468 |
| Please reload this page | https://github.com/python/mypy/pull/17344 |
| Please reload this page | https://github.com/python/mypy/pull/17344 |
| https://github.com/Jordandev678 |
| Jordandev678 | https://github.com/Jordandev678 |
| Jun 9, 2024 | https://github.com/python/mypy/pull/17344#issuecomment-2156590800 |
| https://github.com/mongodb/mongo-python-driver | https://github.com/mongodb/mongo-python-driver |
| https://github.com/Rapptz/discord.py | https://github.com/Rapptz/discord.py |
| Please reload this page | https://github.com/python/mypy/pull/17344 |
| https://github.com/Jordandev678 |
| Jordandev678 | https://github.com/Jordandev678 |
| June 9, 2024 13:06 | https://github.com/python/mypy/pull/17344#event-13091395565 |
| https://github.com/jakkdl |
| jakkdl | https://github.com/jakkdl |
| Jun 20, 2024 | https://github.com/python/mypy/pull/17344#issuecomment-2181529547 |
| Please reload this page | https://github.com/python/mypy/pull/17344 |
| https://github.com/Jordandev678 |
| Jordandev678 | https://github.com/Jordandev678 |
| Jun 20, 2024 | https://github.com/python/mypy/pull/17344#issuecomment-2181556919 |
| Please reload this page | https://github.com/python/mypy/pull/17344 |
| https://github.com/jakkdl |
| jakkdl | https://github.com/jakkdl |
| Jun 20, 2024 | https://github.com/python/mypy/pull/17344#issuecomment-2181571708 |
| @ilevkivskyi | https://github.com/ilevkivskyi |
| @JukkaL | https://github.com/JukkaL |
| Please reload this page | https://github.com/python/mypy/pull/17344 |
| https://github.com/hauntsaninja |
| hauntsaninja | https://github.com/hauntsaninja |
|
upnext
| https://github.com/python/mypy/issues?q=state%3Aopen%20label%3Aupnext |
| Jun 21, 2024 | https://github.com/python/mypy/pull/17344#event-13238645030 |
| https://github.com/hauntsaninja |
| hauntsaninja | https://github.com/hauntsaninja |
|
Jul 24, 2024
| https://github.com/python/mypy/pull/17344#pullrequestreview-2195720337 |
|
View reviewed changes
| https://github.com/python/mypy/pull/17344/files/0bb56898805e16a7e00cc483eefa5250f289ef5d |
| hauntsaninja | https://github.com/hauntsaninja |
| https://github.com/python/mypy/pull/17344#pullrequestreview-2195720337 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://github.com/python/mypy/pull/17344 |
| https://github.com/hauntsaninja |
| hauntsaninja | https://github.com/hauntsaninja |
| ed0cd4a | https://github.com/python/mypy/commit/ed0cd4acba02ed19b1cf18ac0ac416dc251d7714 |
| Jul 24, 2024 | https://github.com/python/mypy/pull/17344#event-13625217932 |
| https://github.com/cdce8p |
| cdce8p | https://github.com/cdce8p |
|
Jul 25, 2024
| https://github.com/python/mypy/pull/17344#ref-pullrequest-2430830420 |
|
Update mypy-dev to 1.12.0a2
home-assistant/core#122613
| https://github.com/home-assistant/core/pull/122613 |
| https://github.com/JukkaL |
| JukkaL | https://github.com/JukkaL |
|
Oct 2, 2024
| https://github.com/python/mypy/pull/17344#ref-issue-2561804300 |
|
Narrowing inconsistency between == and "in"
#17864
| https://github.com/python/mypy/issues/17864 |
| JukkaL | https://github.com/JukkaL |
|
Oct 2, 2024
| https://github.com/python/mypy/pull/17344#ref-commit-4aade6a |
|
| https://github.com/JukkaL |
| Revert "Narrow based on collection containment ( | https://github.com/python/mypy/commit/4aade6a582d17945fb2895a4a5fbb8b045f180b5 |
| #17344 | https://github.com/python/mypy/pull/17344 |
| )" | https://github.com/python/mypy/commit/4aade6a582d17945fb2895a4a5fbb8b045f180b5 |
| 4aade6a | https://github.com/python/mypy/commit/4aade6a582d17945fb2895a4a5fbb8b045f180b5 |
| ed0cd4a | https://github.com/python/mypy/commit/ed0cd4acba02ed19b1cf18ac0ac416dc251d7714 |
| #17864 | https://github.com/python/mypy/issues/17864 |
| JukkaL | https://github.com/JukkaL |
|
Oct 2, 2024
| https://github.com/python/mypy/pull/17344#ref-commit-329e38e |
|
| https://github.com/JukkaL |
| Revert "Narrow based on collection containment ( | https://github.com/python/mypy/commit/329e38e6f23c92d6be7c7839d3b44bf7e2b517dc |
| #17344 | https://github.com/python/mypy/pull/17344 |
| )" ( | https://github.com/python/mypy/commit/329e38e6f23c92d6be7c7839d3b44bf7e2b517dc |
| #17865 | https://github.com/python/mypy/pull/17865 |
| ) | https://github.com/python/mypy/commit/329e38e6f23c92d6be7c7839d3b44bf7e2b517dc |
| 329e38e | https://github.com/python/mypy/commit/329e38e6f23c92d6be7c7839d3b44bf7e2b517dc |
| ed0cd4a | https://github.com/python/mypy/commit/ed0cd4acba02ed19b1cf18ac0ac416dc251d7714 |
| #17864 | https://github.com/python/mypy/issues/17864 |
| #17864 | https://github.com/python/mypy/issues/17864 |
| #17841 | https://github.com/python/mypy/issues/17841 |
| Jordandev678 | https://github.com/Jordandev678 |
|
Oct 9, 2024
| https://github.com/python/mypy/pull/17344#ref-commit-7ddf821 |
|
| https://github.com/Jordandev678 |
| Reapply "Narrow based on collection containment ( | https://github.com/Jordandev678/mypy/commit/7ddf82190d2744a7d023fcb252b4c62be4a1531c |
| python#17344 | https://github.com/python/mypy/pull/17344 |
| )" ( | https://github.com/Jordandev678/mypy/commit/7ddf82190d2744a7d023fcb252b4c62be4a1531c |
| pyth… | https://github.com/python/mypy/pull/17865 |
| 7ddf821 | https://github.com/Jordandev678/mypy/commit/7ddf82190d2744a7d023fcb252b4c62be4a1531c |
| …on#17865 | https://github.com/python/mypy/pull/17865 |
| 329e38e | https://github.com/Jordandev678/mypy/commit/329e38e6f23c92d6be7c7839d3b44bf7e2b517dc |
| https://github.com/tyralla |
| tyralla | https://github.com/tyralla |
|
Oct 26, 2024
| https://github.com/python/mypy/pull/17344#ref-pullrequest-2190770248 |
|
Support narrowing literals and enums using the in operator in combination with list, set, and tuple expressions.
#17044
| https://github.com/python/mypy/pull/17044 |
| https://github.com/hauntsaninja |
| hauntsaninja | https://github.com/hauntsaninja |
|
Jan 16, 2026
| https://github.com/python/mypy/pull/17344#ref-pullrequest-3823772196 |
|
Narrow types based on collection containment
#20602
| https://github.com/python/mypy/pull/20602 |
| 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%2F17344 |
|
| https://github.com/hauntsaninja |
|
hauntsaninja
| https://github.com/hauntsaninja |
|
| https://github.com/python/mypy/pull/17344/files/0bb56898805e16a7e00cc483eefa5250f289ef5d |
|
upnext
| https://github.com/python/mypy/issues?q=state%3Aopen%20label%3Aupnext |
|
Type not narrowed correctly for if X in collection
| https://github.com/python/mypy/issues/3229 |
| Please reload this page | https://github.com/python/mypy/pull/17344 |
|
| https://github.com/Jordandev678 |
|
| https://github.com/jakkdl |
|
| https://github.com/hauntsaninja |
|
| 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 |