René's URL Explorer Experiment


Title: Generalize reachability checks to support enums by Michael0x2a · Pull Request #7000 · python/mypy · GitHub

Open Graph Title: Generalize reachability checks to support enums by Michael0x2a · Pull Request #7000 · python/mypy

X Title: Generalize reachability checks to support enums by Michael0x2a · Pull Request #7000 · python/mypy

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

Open Graph Description: Fixes #1803 This diff adds support for performing reachability and narrowing analysis when doing certain enum checks. For example, given the following enum: class Foo(Enum): A = 1 B = 2 .....

X Description: Fixes #1803 This diff adds support for performing reachability and narrowing analysis when doing certain enum checks. For example, given the following enum: class Foo(Enum): A = 1 B = 2 .....

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

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:aab27946-e728-29b0-b203-803846de8176
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCD90:30CC09:2702F70:34D5838:6B003797
html-safe-nonce6d73d9def2ad0d5a6c8b5d0823b436b7e515e703df5a0b98036c65c9d03c3d82
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDkwOjMwQ0MwOToyNzAyRjcwOjM0RDU4Mzg6NkIwMDM3OTciLCJ2aXNpdG9yX2lkIjoiNDA2NTYwMDk1NTk2ODY2NTQ5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacefeb30340526b6ee6e14a1ccee7a6ef960b99b35fe2d63fa87974b41de81f8f6
hovercard-subject-tagpull_request:288606461
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/7000/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/aaf29d4d09254dfdac435dac7cd01eba06bbd3dcc53ce5209adb569161fd8745/python/mypy/pull/7000
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/aaf29d4d09254dfdac435dac7cd01eba06bbd3dcc53ce5209adb569161fd8745/python/mypy/pull/7000
og:image:altFixes #1803 This diff adds support for performing reachability and narrowing analysis when doing certain enum checks. For example, given the following enum: class Foo(Enum): A = 1 B = 2 .....
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameMichael0x2a
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
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
releasef3f3a43ca095cdea3abbb394112e971f9fdb94fa
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-namepull-requests

Links:

Skip to contenthttps://github.com/python/mypy/pull/7000#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F7000
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%2F7000
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/7000
Reloadhttps://github.com/python/mypy/pull/7000
Reloadhttps://github.com/python/mypy/pull/7000
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 requests545 (545)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
ilevkivskyihttps://github.com/ilevkivskyi
python:masterhttps://github.com/python/mypy/tree/master
Michael0x2a:refine-enum-branch-analysishttps://github.com/Michael0x2a/mypy/tree/refine-enum-branch-analysis
Conversationhttps://github.com/python/mypy/pull/7000
Commits8 (8)https://github.com/python/mypy/pull/7000/commits
Checkshttps://github.com/python/mypy/pull/7000/checks
Files changedhttps://github.com/python/mypy/pull/7000/files
Generalize reachability checks to support enumshttps://github.com/python/mypy/pull/7000#top
ilevkivskyihttps://github.com/ilevkivskyi
python:masterhttps://github.com/python/mypy/tree/master
Michael0x2a:refine-enum-branch-analysishttps://github.com/Michael0x2a/mypy/tree/refine-enum-branch-analysis
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Jun 16, 2019https://github.com/python/mypy/pull/7000#issue-456613801
Please reload this pagehttps://github.com/python/mypy/pull/7000
#1803https://github.com/python/mypy/issues/1803
described in PEP 484https://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unions
#6366https://github.com/python/mypy/issues/6366
Please reload this pagehttps://github.com/python/mypy/pull/7000
Michael0x2ahttps://github.com/Michael0x2a
June 16, 2019 00:53https://github.com/python/mypy/pull/7000#commits-pushed-df76db6
https://github.com/Michael0x2a
Generalize reachability checks to support enumshttps://github.com/python/mypy/pull/7000/commits/df76db6b1b00078aeae9e81d6ad9fe512313b20a
df76db6https://github.com/python/mypy/pull/7000/commits/df76db6b1b00078aeae9e81d6ad9fe512313b20a
python#6366https://github.com/python/mypy/issues/6366
https://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unionshttps://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unions
https://github.com/Michael0x2a
Sort generated enum union by name for older versions of Pythonhttps://github.com/python/mypy/pull/7000/commits/eaa0872fc1a910d9f482231b3cf8957103fe2964
eaa0872https://github.com/python/mypy/pull/7000/commits/eaa0872fc1a910d9f482231b3cf8957103fe2964
https://github.com/bluetech
bluetechhttps://github.com/bluetech
Jun 17, 2019https://github.com/python/mypy/pull/7000#issuecomment-502587389
Please reload this pagehttps://github.com/python/mypy/pull/7000
https://github.com/bluetech
bluetechhttps://github.com/bluetech
Jun 17, 2019 https://github.com/python/mypy/pull/7000#pullrequestreview-250360395
View reviewed changes https://github.com/python/mypy/pull/7000/files/eaa0872fc1a910d9f482231b3cf8957103fe2964
mypy/checker.pyhttps://github.com/python/mypy/pull/7000/files/eaa0872fc1a910d9f482231b3cf8957103fe2964#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
Please reload this pagehttps://github.com/python/mypy/pull/7000
https://github.com/Michael0x2a
https://github.com/bluetech
Add missing word to docstringhttps://github.com/python/mypy/pull/7000/commits/4cb557249a2bde0be0d4a122744c9f6268b7c710
4cb5572https://github.com/python/mypy/pull/7000/commits/4cb557249a2bde0be0d4a122744c9f6268b7c710
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Jun 17, 2019https://github.com/python/mypy/pull/7000#issuecomment-502749902
Please reload this pagehttps://github.com/python/mypy/pull/7000
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Jun 17, 2019https://github.com/python/mypy/pull/7000#issuecomment-502755249
Please reload this pagehttps://github.com/python/mypy/pull/7000
https://github.com/Michael0x2a
Merge branch 'master' into refine-enum-branch-analysishttps://github.com/python/mypy/pull/7000/commits/0c084dcb278974f2267c174d55ee1d03b49051ba
0c084dchttps://github.com/python/mypy/pull/7000/commits/0c084dcb278974f2267c174d55ee1d03b49051ba
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Jul 2, 2019 https://github.com/python/mypy/pull/7000#ref-issue-463399598
Release 0.720 planning #7137 https://github.com/python/mypy/issues/7137
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Jul 6, 2019 https://github.com/python/mypy/pull/7000#pullrequestreview-258598557
View reviewed changes https://github.com/python/mypy/pull/7000/files/0c084dcb278974f2267c174d55ee1d03b49051ba
ilevkivskyihttps://github.com/ilevkivskyi
https://github.com/python/mypy/pull/7000#pullrequestreview-258598557
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
#1803https://github.com/python/mypy/issues/1803
Please reload this pagehttps://github.com/python/mypy/pull/7000
mypy/checker.pyhttps://github.com/python/mypy/pull/7000/files/0c084dcb278974f2267c174d55ee1d03b49051ba#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
ilevkivskyihttps://github.com/ilevkivskyi
Jul 6, 2019https://github.com/python/mypy/pull/7000#discussion_r300839230
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7000
Michael0x2ahttps://github.com/Michael0x2a
Jul 8, 2019https://github.com/python/mypy/pull/7000#discussion_r300972244
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7000
ilevkivskyihttps://github.com/ilevkivskyi
Jul 8, 2019https://github.com/python/mypy/pull/7000#discussion_r301087649
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7000
Michael0x2ahttps://github.com/Michael0x2a
Jul 8, 2019https://github.com/python/mypy/pull/7000#discussion_r301153755
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7000
mypy/checker.pyhttps://github.com/python/mypy/pull/7000/files/0c084dcb278974f2267c174d55ee1d03b49051ba#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
Please reload this pagehttps://github.com/python/mypy/pull/7000
mypy/checker.pyhttps://github.com/python/mypy/pull/7000/files/0c084dcb278974f2267c174d55ee1d03b49051ba#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
ilevkivskyihttps://github.com/ilevkivskyi
Jul 6, 2019https://github.com/python/mypy/pull/7000#discussion_r300839753
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
#4223https://github.com/python/mypy/issues/4223
Please reload this pagehttps://github.com/python/mypy/pull/7000
Michael0x2ahttps://github.com/Michael0x2a
Jul 8, 2019https://github.com/python/mypy/pull/7000#discussion_r300972215
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7000
Michael0x2ahttps://github.com/Michael0x2a
July 6, 2019 14:33https://github.com/python/mypy/pull/7000#commits-pushed-5ec6868
https://github.com/Michael0x2a
Merge branch 'master' into refine-enum-branch-analysishttps://github.com/python/mypy/pull/7000/commits/5ec686898053b9f9932e416ecc29dda8c409a79a
5ec6868https://github.com/python/mypy/pull/7000/commits/5ec686898053b9f9932e416ecc29dda8c409a79a
https://github.com/Michael0x2a
Convert errors to notes for reveal_type(...)https://github.com/python/mypy/pull/7000/commits/1d95ec0a4ca30f8fa0b4afa5419081f4b8dd24ec
1d95ec0https://github.com/python/mypy/pull/7000/commits/1d95ec0a4ca30f8fa0b4afa5419081f4b8dd24ec
https://github.com/Michael0x2a
Update commenthttps://github.com/python/mypy/pull/7000/commits/d1d99a7c0b56181ffca4ac4487fa824b58c27436
d1d99a7https://github.com/python/mypy/pull/7000/commits/d1d99a7c0b56181ffca4ac4487fa824b58c27436
https://github.com/Michael0x2a
Merge branch 'refine-enum-branch-analysis' of github.com:Michael0x2a/…https://github.com/python/mypy/pull/7000/commits/5b70ff5cb12a9884305466fc29ee071e72aae969
5b70ff5https://github.com/python/mypy/pull/7000/commits/5b70ff5cb12a9884305466fc29ee071e72aae969
https://github.com/Michael0x2a
Michael0x2ahttps://github.com/Michael0x2a
Jul 8, 2019 https://github.com/python/mypy/pull/7000#ref-pullrequest-465127850
Make reachability code understand chained comparisons #7169 https://github.com/python/mypy/pull/7169
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Jul 8, 2019 https://github.com/python/mypy/pull/7000#pullrequestreview-258895312
View reviewed changes https://github.com/python/mypy/pull/7000/files/5b70ff5cb12a9884305466fc29ee071e72aae969
ilevkivskyihttps://github.com/ilevkivskyi
https://github.com/python/mypy/pull/7000#pullrequestreview-258895312
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7000
mypy/checker.pyhttps://github.com/python/mypy/pull/7000/files/0c084dcb278974f2267c174d55ee1d03b49051ba#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
ilevkivskyihttps://github.com/ilevkivskyi
Jul 8, 2019https://github.com/python/mypy/pull/7000#discussion_r301087649
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7000
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Jul 8, 2019 https://github.com/python/mypy/pull/7000#pullrequestreview-258979114
View reviewed changes https://github.com/python/mypy/pull/7000/files/5b70ff5cb12a9884305466fc29ee071e72aae969
ilevkivskyihttps://github.com/ilevkivskyi
https://github.com/python/mypy/pull/7000#pullrequestreview-258979114
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/7000
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
e818a96https://github.com/python/mypy/commit/e818a96917a5111c4a5b901d49aa6b36de9700d3
Jul 8, 2019https://github.com/python/mypy/pull/7000#event-2466543538
https://github.com/lmazuel
lmazuelhttps://github.com/lmazuel
Aug 1, 2019 https://github.com/python/mypy/pull/7000#ref-issue-475932641
Singleton as enum doesn't work as expected #7279 https://github.com/python/mypy/issues/7279
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
Aug 3, 2021 https://github.com/python/mypy/pull/7000#ref-issue-958740045
support narrowing enum values using == and != #10915 https://github.com/python/mypy/issues/10915
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%2F7000
https://github.com/ilevkivskyi
ilevkivskyi https://github.com/ilevkivskyi
https://github.com/python/mypy/pull/7000/files/5b70ff5cb12a9884305466fc29ee071e72aae969
https://github.com/bluetech
bluetech https://github.com/bluetech
https://github.com/python/mypy/pull/7000/files/eaa0872fc1a910d9f482231b3cf8957103fe2964
Please reload this pagehttps://github.com/python/mypy/pull/7000
Support enums in unions per PEP 484 https://github.com/python/mypy/issues/1803
Please reload this pagehttps://github.com/python/mypy/pull/7000
https://github.com/Michael0x2a
https://github.com/bluetech
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.