René's URL Explorer Experiment


Title: Refine parent type when narrowing "lookup" expressions by Michael0x2a · Pull Request #7917 · python/mypy · GitHub

Open Graph Title: Refine parent type when narrowing "lookup" expressions by Michael0x2a · Pull Request #7917 · python/mypy

X Title: Refine parent type when narrowing "lookup" expressions by Michael0x2a · Pull Request #7917 · python/mypy

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

Open Graph Description: This diff adds support for the following pattern: from typing import Enum, List from enum import Enum class Key(Enum): A = 1 B = 2 class Foo: key: Literal[Key.A] blah: List[int] ...

X Description: This diff adds support for the following pattern: from typing import Enum, List from enum import Enum class Key(Enum): A = 1 B = 2 class Foo: key: Literal[Key.A] blah: List[int] ...

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

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:538678d9-0b81-c196-35fb-502360beee82
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBD60:30E5B0:299868C:3685B78:6B000A12
html-safe-nonce42ca6c2c0c8e3734ab9be675e58c9020b28b4b052cc51c7559b8e1b09d4b77a3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDYwOjMwRTVCMDoyOTk4NjhDOjM2ODVCNzg6NkIwMDBBMTIiLCJ2aXNpdG9yX2lkIjoiOTAyMTY3ODY2OTMyNzc2Mzk4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac5a4557caf9cfec17c77a3dee92e2d5cce091f21c9e383553eee5e3098ed27c75
hovercard-subject-tagpull_request:339097637
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/7917/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/85e79866e524782f1c0d6fd8e466accca557f4a9765d8da45de77c3bcffd42fa/python/mypy/pull/7917
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/85e79866e524782f1c0d6fd8e466accca557f4a9765d8da45de77c3bcffd42fa/python/mypy/pull/7917
og:image:altThis diff adds support for the following pattern: from typing import Enum, List from enum import Enum class Key(Enum): A = 1 B = 2 class Foo: key: Literal[Key.A] blah: List[int] ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameMichael0x2a
hostnamegithub.com
expected-hostnamegithub.com
None0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729
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
release16a11879678aaf97e2a42c33ee70830aa084fa37
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/python/mypy/pull/7917#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F7917
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%2F7917
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/7917
Reloadhttps://github.com/python/mypy/pull/7917
Reloadhttps://github.com/python/mypy/pull/7917
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 requests547 (547)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
Michael0x2ahttps://github.com/Michael0x2a
python:masterhttps://github.com/python/mypy/tree/master
Michael0x2a:add-parent-refinementhttps://github.com/Michael0x2a/mypy/tree/add-parent-refinement
Conversationhttps://github.com/python/mypy/pull/7917
Commits9 (9)https://github.com/python/mypy/pull/7917/commits
Checkshttps://github.com/python/mypy/pull/7917/checks
Files changedhttps://github.com/python/mypy/pull/7917/files
Refine parent type when narrowing "lookup" expressionshttps://github.com/python/mypy/pull/7917#top
Michael0x2ahttps://github.com/Michael0x2a
python:masterhttps://github.com/python/mypy/tree/master
Michael0x2a:add-parent-refinementhttps://github.com/Michael0x2a/mypy/tree/add-parent-refinement
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Nov 9, 2019https://github.com/python/mypy/pull/7917#issue-520526312
#7905https://github.com/python/mypy/issues/7905
#7344https://github.com/python/mypy/issues/7344
#7169https://github.com/python/mypy/pull/7169
Please reload this pagehttps://github.com/python/mypy/pull/7917
https://github.com/Michael0x2a
Refine parent type when narrowing "lookup" expressionshttps://github.com/python/mypy/pull/7917/commits/14fa27f167d23fab76942e8d943daae6100e225b
14fa27fhttps://github.com/python/mypy/pull/7917/commits/14fa27f167d23fab76942e8d943daae6100e225b
python#7905https://github.com/python/mypy/issues/7905
python#7344https://github.com/python/mypy/issues/7344
python#7169https://github.com/python/mypy/pull/7169
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Nov 9, 2019https://github.com/python/mypy/pull/7917#issuecomment-552146324
Please reload this pagehttps://github.com/python/mypy/pull/7917
Michael0x2ahttps://github.com/Michael0x2a
November 9, 2019 15:54https://github.com/python/mypy/pull/7917#commits-pushed-b707f3d
https://github.com/Michael0x2a
Import Type from typing_extensions for Python 3.5.1https://github.com/python/mypy/pull/7917/commits/b707f3d89a9172ee87270fc9a31479f6bd00c6e7
b707f3dhttps://github.com/python/mypy/pull/7917/commits/b707f3d89a9172ee87270fc9a31479f6bd00c6e7
https://github.com/Michael0x2a
Remove out-of-date commenthttps://github.com/python/mypy/pull/7917/commits/d183f1c100cd85bd5d9636c12c19719970a9dc8b
d183f1chttps://github.com/python/mypy/pull/7917/commits/d183f1c100cd85bd5d9636c12c19719970a9dc8b
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Nov 11, 2019 https://github.com/python/mypy/pull/7917#pullrequestreview-314882671
View reviewed changes https://github.com/python/mypy/pull/7917/files/d183f1c100cd85bd5d9636c12c19719970a9dc8b
ilevkivskyihttps://github.com/ilevkivskyi
https://github.com/python/mypy/pull/7917#pullrequestreview-314882671
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7917
test-data/unit/check-narrowing.testhttps://github.com/python/mypy/pull/7917/files/d183f1c100cd85bd5d9636c12c19719970a9dc8b#diff-0413401ad6a91bc5c66579455009ba606ee0ddfb0a78278c9e53618c83b53ed5
Please reload this pagehttps://github.com/python/mypy/pull/7917
test-data/unit/check-narrowing.testhttps://github.com/python/mypy/pull/7917/files/d183f1c100cd85bd5d9636c12c19719970a9dc8b#diff-0413401ad6a91bc5c66579455009ba606ee0ddfb0a78278c9e53618c83b53ed5
Please reload this pagehttps://github.com/python/mypy/pull/7917
test-data/unit/check-narrowing.testhttps://github.com/python/mypy/pull/7917/files/d183f1c100cd85bd5d9636c12c19719970a9dc8b#diff-0413401ad6a91bc5c66579455009ba606ee0ddfb0a78278c9e53618c83b53ed5
ilevkivskyihttps://github.com/ilevkivskyi
Nov 11, 2019https://github.com/python/mypy/pull/7917#discussion_r344701916
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7917
test-data/unit/check-narrowing.testhttps://github.com/python/mypy/pull/7917/files/d183f1c100cd85bd5d9636c12c19719970a9dc8b#diff-0413401ad6a91bc5c66579455009ba606ee0ddfb0a78278c9e53618c83b53ed5
Please reload this pagehttps://github.com/python/mypy/pull/7917
test-data/unit/fixtures/tuple.pyihttps://github.com/python/mypy/pull/7917/files/d183f1c100cd85bd5d9636c12c19719970a9dc8b#diff-06f53ec897af7de8980f5587d37a453b95426d0d6f8acfde9638bcc666b31a78
ilevkivskyihttps://github.com/ilevkivskyi
Nov 11, 2019https://github.com/python/mypy/pull/7917#discussion_r344702744
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7917
Michael0x2ahttps://github.com/Michael0x2a
Nov 11, 2019https://github.com/python/mypy/pull/7917#discussion_r344859665
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7917
mypy/typeops.pyhttps://github.com/python/mypy/pull/7917/files/d183f1c100cd85bd5d9636c12c19719970a9dc8b#diff-1dce7e2a19559e2ff4e08fd46877b87c9cfec3cb5e6d465157788542948e11e4
ilevkivskyihttps://github.com/ilevkivskyi
Nov 11, 2019https://github.com/python/mypy/pull/7917#discussion_r344703042
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7917
Michael0x2ahttps://github.com/Michael0x2a
Nov 11, 2019https://github.com/python/mypy/pull/7917#discussion_r344860500
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
#6138https://github.com/python/mypy/issues/6138
#6123https://github.com/python/mypy/issues/6123
Please reload this pagehttps://github.com/python/mypy/pull/7917
ilevkivskyihttps://github.com/ilevkivskyi
Nov 11, 2019https://github.com/python/mypy/pull/7917#discussion_r344862944
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7917
mypy/checker.pyhttps://github.com/python/mypy/pull/7917/files/d183f1c100cd85bd5d9636c12c19719970a9dc8b#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
Please reload this pagehttps://github.com/python/mypy/pull/7917
mypy/checker.pyhttps://github.com/python/mypy/pull/7917/files/d183f1c100cd85bd5d9636c12c19719970a9dc8b#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
ilevkivskyihttps://github.com/ilevkivskyi
Nov 11, 2019https://github.com/python/mypy/pull/7917#discussion_r344719770
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7917
Michael0x2ahttps://github.com/Michael0x2a
November 11, 2019 10:57https://github.com/python/mypy/pull/7917#commits-pushed-2c2506d
https://github.com/Michael0x2a
Respond to code reviewhttps://github.com/python/mypy/pull/7917/commits/2c2506de0f6312f1958f2d458de76470b0d4ac6c
2c2506dhttps://github.com/python/mypy/pull/7917/commits/2c2506de0f6312f1958f2d458de76470b0d4ac6c
https://github.com/Michael0x2a
Refactor replay lookup for index exprshttps://github.com/python/mypy/pull/7917/commits/0c331479fef1a38c0d0af2ebd29967616d0ce19a
0c33147https://github.com/python/mypy/pull/7917/commits/0c331479fef1a38c0d0af2ebd29967616d0ce19a
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Nov 11, 2019https://github.com/python/mypy/pull/7917#issuecomment-552577702
@ilevkivskyihttps://github.com/ilevkivskyi
Please reload this pagehttps://github.com/python/mypy/pull/7917
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Nov 11, 2019 https://github.com/python/mypy/pull/7917#pullrequestreview-315149010
View reviewed changes https://github.com/python/mypy/pull/7917/files/0c331479fef1a38c0d0af2ebd29967616d0ce19a
ilevkivskyihttps://github.com/ilevkivskyi
https://github.com/python/mypy/pull/7917#pullrequestreview-315149010
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7917
mypy/checker.pyhttps://github.com/python/mypy/pull/7917/files/0c331479fef1a38c0d0af2ebd29967616d0ce19a#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
ilevkivskyihttps://github.com/ilevkivskyi
Nov 11, 2019https://github.com/python/mypy/pull/7917#discussion_r344903766
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7917
mypy/checker.pyhttps://github.com/python/mypy/pull/7917/files/0c331479fef1a38c0d0af2ebd29967616d0ce19a#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
ilevkivskyihttps://github.com/ilevkivskyi
Nov 11, 2019https://github.com/python/mypy/pull/7917#discussion_r344904219
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7917
test-data/unit/check-narrowing.testhttps://github.com/python/mypy/pull/7917/files/0c331479fef1a38c0d0af2ebd29967616d0ce19a#diff-0413401ad6a91bc5c66579455009ba606ee0ddfb0a78278c9e53618c83b53ed5
ilevkivskyihttps://github.com/ilevkivskyi
Nov 11, 2019https://github.com/python/mypy/pull/7917#discussion_r344906407
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7917
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Nov 11, 2019https://github.com/python/mypy/pull/7917#issuecomment-552613450
@Michael0x2ahttps://github.com/Michael0x2a
Please reload this pagehttps://github.com/python/mypy/pull/7917
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Nov 12, 2019 https://github.com/python/mypy/pull/7917#ref-issue-521337297
Isinstance checks against Type[SomeProtocol] unexpectedly fails #7932 https://github.com/python/mypy/issues/7932
https://github.com/Michael0x2a
Respond to second code reviewhttps://github.com/python/mypy/pull/7917/commits/68b4801444b1838d162844e73a25d090a206a443
68b4801https://github.com/python/mypy/pull/7917/commits/68b4801444b1838d162844e73a25d090a206a443
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Nov 12, 2019https://github.com/python/mypy/pull/7917#event-2790368163
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Nov 12, 2019https://github.com/python/mypy/pull/7917#event-2790368258
Michael0x2ahttps://github.com/Michael0x2a
November 12, 2019 17:08https://github.com/python/mypy/pull/7917#commits-pushed-c2b2cce
https://github.com/Michael0x2a
Revert index lookup helper refactoringhttps://github.com/python/mypy/pull/7917/commits/c2b2ccedbb2b18cd7ff10f73dc61c2f6ffa9559e
c2b2ccehttps://github.com/python/mypy/pull/7917/commits/c2b2ccedbb2b18cd7ff10f73dc61c2f6ffa9559e
https://github.com/Michael0x2a
Merge branch 'master' into add-parent-refinementhttps://github.com/python/mypy/pull/7917/commits/0c53aad5cb78d6b56008757e59c49c26201eb662
0c53aadhttps://github.com/python/mypy/pull/7917/commits/0c53aad5cb78d6b56008757e59c49c26201eb662
https://github.com/Michael0x2a
Fix lint error from bad mergehttps://github.com/python/mypy/pull/7917/commits/b4f35eab18dd0e46133261bcb2fb3aeaccac178f
b4f35eahttps://github.com/python/mypy/pull/7917/commits/b4f35eab18dd0e46133261bcb2fb3aeaccac178f
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
648d99ahttps://github.com/python/mypy/commit/648d99aaac2436358aabefa8be018632768c3e3e
Nov 13, 2019https://github.com/python/mypy/pull/7917#event-2793645016
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
November 13, 2019 02:03https://github.com/python/mypy/pull/7917#event-2793645158
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%2F7917
https://github.com/ilevkivskyi
ilevkivskyi https://github.com/ilevkivskyi
https://github.com/python/mypy/pull/7917/files/0c331479fef1a38c0d0af2ebd29967616d0ce19a
Please reload this pagehttps://github.com/python/mypy/pull/7917
Type detection doesn't work with TypedDict https://github.com/python/mypy/issues/7344
Please reload this pagehttps://github.com/python/mypy/pull/7917
https://github.com/Michael0x2a
https://github.com/ilevkivskyi
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.