René's URL Explorer Experiment


Title: Avoid false `unreachable` and `redundant-expr` warnings in loops. by tyralla · Pull Request #18433 · python/mypy · GitHub

Open Graph Title: Avoid false `unreachable` and `redundant-expr` warnings in loops. by tyralla · Pull Request #18433 · python/mypy

X Title: Avoid false `unreachable` and `redundant-expr` warnings in loops. by tyralla · Pull Request #18433 · python/mypy

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

Open Graph Description: Fixes #18348 Fixes #13973 Fixes #11612 Fixes #8721 Fixes #8865 Fixes #7204 I manually checked all the listed issues. Some of them were already partly fixed by #18180.

X Description: Fixes #18348 Fixes #13973 Fixes #11612 Fixes #8721 Fixes #8865 Fixes #7204 I manually checked all the listed issues. Some of them were already partly fixed by #18180.

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

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:f0e68b5d-e3a7-288e-5577-73af20ee607b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC414:1D6C27:68F9BE:8BD1BC:6A5B5EA9
html-safe-nonceac70fc8f951036c1c817b38ae23fd905a308f31af81e333320efe26076f2b1c3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDE0OjFENkMyNzo2OEY5QkU6OEJEMUJDOjZBNUI1RUE5IiwidmlzaXRvcl9pZCI6IjE2ODM1Njc0Njg4ODYwNTY2MTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd08c3c55ecba91d028a16e7e8ee7253076983c64c8b4297a10c19edfa3b13663
hovercard-subject-tagpull_request:2269410406
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/18433/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/94a6165ffda7ef5ab6734fe82d0b371cecda0ccd7f570c88916664bc5e32e54c/python/mypy/pull/18433
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/94a6165ffda7ef5ab6734fe82d0b371cecda0ccd7f570c88916664bc5e32e54c/python/mypy/pull/18433
og:image:altFixes #18348 Fixes #13973 Fixes #11612 Fixes #8721 Fixes #8865 Fixes #7204 I manually checked all the listed issues. Some of them were already partly fixed by #18180.
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametyralla
hostnamegithub.com
expected-hostnamegithub.com
None5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b
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
release9c975978430e9ad293956f2bbdaf153b1bd84a99
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/mypy/pull/18433#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F18433
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%2F18433
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/18433
Reloadhttps://github.com/python/mypy/pull/18433
Reloadhttps://github.com/python/mypy/pull/18433
Please reload this pagehttps://github.com/python/mypy/pull/18433
python https://github.com/python
mypyhttps://github.com/python/mypy
Please reload this pagehttps://github.com/python/mypy/pull/18433
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 467 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
tyralla:fix/binder_loophttps://github.com/tyralla/mypy/tree/fix/binder_loop
Conversationhttps://github.com/python/mypy/pull/18433
Commits3 (3)https://github.com/python/mypy/pull/18433/commits
Checkshttps://github.com/python/mypy/pull/18433/checks
Files changedhttps://github.com/python/mypy/pull/18433/files
Avoid false unreachable and redundant-expr warnings in loops.https://github.com/python/mypy/pull/18433#top
hauntsaninjahttps://github.com/hauntsaninja
python:masterhttps://github.com/python/mypy/tree/master
tyralla:fix/binder_loophttps://github.com/tyralla/mypy/tree/fix/binder_loop
https://github.com/tyralla
tyrallahttps://github.com/tyralla
Jan 9, 2025https://github.com/python/mypy/pull/18433#issue-2778954315
#18348https://github.com/python/mypy/issues/18348
#13973https://github.com/python/mypy/issues/13973
#11612https://github.com/python/mypy/issues/11612
#8721https://github.com/python/mypy/issues/8721
#8865https://github.com/python/mypy/issues/8865
#7204https://github.com/python/mypy/issues/7204
#18180https://github.com/python/mypy/pull/18180
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/tyralla
Avoid false unreachable and redundant-expr warnings in loops.https://github.com/python/mypy/pull/18433/commits/53d894a8ea84d3d12043b5678dda39954dbf4a6f
53d894ahttps://github.com/python/mypy/pull/18433/commits/53d894a8ea84d3d12043b5678dda39954dbf4a6f
python#18348https://github.com/python/mypy/issues/18348
python#13973https://github.com/python/mypy/issues/13973
python#11612https://github.com/python/mypy/issues/11612
python#8721https://github.com/python/mypy/issues/8721
python#8865https://github.com/python/mypy/issues/8865
python#7204https://github.com/python/mypy/issues/7204
python#18180https://github.com/python/mypy/pull/18180
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F18433
https://github.com/tyralla
tyrallahttps://github.com/tyralla
Jan 9, 2025https://github.com/python/mypy/pull/18433#issuecomment-2581464021
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/tyralla
Do not enable REDUNDANT_EXPR accidentally.https://github.com/python/mypy/pull/18433/commits/9b54ab1635a8a7e6d81ce7d304bf0e2a289a7704
9b54ab1https://github.com/python/mypy/pull/18433/commits/9b54ab1635a8a7e6d81ce7d304bf0e2a289a7704
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
Jan 10, 2025 https://github.com/python/mypy/pull/18433#pullrequestreview-2541399917
View reviewed changes https://github.com/python/mypy/pull/18433/files/53d894a8ea84d3d12043b5678dda39954dbf4a6f
mypy/checker.pyhttps://github.com/python/mypy/pull/18433/files/53d894a8ea84d3d12043b5678dda39954dbf4a6f#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/apps/github-actions
Sign in to viewhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fmypy%2Fpull%2F18433
https://github.com/tyralla
tyrallahttps://github.com/tyralla
Jan 10, 2025https://github.com/python/mypy/pull/18433#issuecomment-2581899106
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/tyralla
tyrallahttps://github.com/tyralla
Jan 10, 2025https://github.com/python/mypy/pull/18433#issuecomment-2583314142
Please reload this pagehttps://github.com/python/mypy/pull/18433
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/tyralla
tyrallahttps://github.com/tyralla
hauntsaninjahttps://github.com/hauntsaninja
January 10, 2025 17:27https://github.com/python/mypy/pull/18433#event-15885269555
https://github.com/sterliakov
sterliakovhttps://github.com/sterliakov
Jan 10, 2025https://github.com/python/mypy/pull/18433#issuecomment-2583379476
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/tyralla
tyrallahttps://github.com/tyralla
Jan 11, 2025https://github.com/python/mypy/pull/18433#issuecomment-2585196018
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Jan 11, 2025 https://github.com/python/mypy/pull/18433#pullrequestreview-2545285596
View reviewed changes https://github.com/python/mypy/pull/18433/files/9b54ab1635a8a7e6d81ce7d304bf0e2a289a7704
ilevkivskyihttps://github.com/ilevkivskyi
https://github.com/python/mypy/pull/18433#pullrequestreview-2545285596
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/18433
mypy/checker.pyhttps://github.com/python/mypy/pull/18433/files/9b54ab1635a8a7e6d81ce7d304bf0e2a289a7704#diff-f96a2d6138bc6cdf2a07c4d37f6071cc25c1631afc107e277a28d5b59fc0ef04
ilevkivskyihttps://github.com/ilevkivskyi
Jan 11, 2025https://github.com/python/mypy/pull/18433#discussion_r1912241141
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/mypy/pull/18433
tyrallahttps://github.com/tyralla
Jan 12, 2025https://github.com/python/mypy/pull/18433#discussion_r1912541767
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
@hauntsaninjahttps://github.com/hauntsaninja
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Jan 11, 2025https://github.com/python/mypy/pull/18433#issuecomment-2585455830
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/tyralla
refactorhttps://github.com/python/mypy/pull/18433/commits/f0fac6dbb805217218e546a632c7b661155df0ce
f0fac6dhttps://github.com/python/mypy/pull/18433/commits/f0fac6dbb805217218e546a632c7b661155df0ce
https://github.com/tyralla
tyrallahttps://github.com/tyralla
Jan 12, 2025https://github.com/python/mypy/pull/18433#issuecomment-2585927176
@ilevkivskyihttps://github.com/ilevkivskyi
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
Jan 12, 2025https://github.com/python/mypy/pull/18433#issuecomment-2585929743
mypy_primerhttps://github.com/hauntsaninja/mypy_primer
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/tyralla
tyrallahttps://github.com/tyralla
Jan 12, 2025https://github.com/python/mypy/pull/18433#issuecomment-2585933476
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
Jan 12, 2025https://github.com/python/mypy/pull/18433#issuecomment-2585941688
Please reload this pagehttps://github.com/python/mypy/pull/18433
#18454https://github.com/python/mypy/issues/18454
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
9685171https://github.com/python/mypy/commit/9685171372e003f2c0bad28706f44fea2d5782b0
Jan 12, 2025https://github.com/python/mypy/pull/18433#event-15897087030
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
Jan 12, 2025https://github.com/python/mypy/pull/18433#issuecomment-2585941837
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
Jan 13, 2025 https://github.com/python/mypy/pull/18433#ref-issue-1650522556
"if condition is always false [redundant-expr]" false positive when variable set in a loop after the conditional #14993 https://github.com/python/mypy/issues/14993
https://github.com/ilevkivskyi
ilevkivskyihttps://github.com/ilevkivskyi
Jan 13, 2025https://github.com/python/mypy/pull/18433#issuecomment-2588364485
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/tyralla
tyrallahttps://github.com/tyralla
Jan 22, 2025 https://github.com/python/mypy/pull/18433#ref-pullrequest-2803463160
Better names of and more compatibility between ad hoc intersections of instances #18506 https://github.com/python/mypy/pull/18506
ilevkivskyihttps://github.com/ilevkivskyi
Jan 22, 2025 https://github.com/python/mypy/pull/18433#ref-commit-878d892
https://github.com/tyralla
https://github.com/marketplace/pre-commit-ci
Better names of and more compatibility between ad hoc intersections o…https://github.com/python/mypy/commit/878d892babba490640e4757a5041dcb575c903b0
878d892https://github.com/python/mypy/commit/878d892babba490640e4757a5041dcb575c903b0
#18506https://github.com/python/mypy/pull/18506
#18433https://github.com/python/mypy/pull/18433
#18433 (comment)https://github.com/python/mypy/pull/18433#issuecomment-2583314142
@ilevkivskyihttps://github.com/ilevkivskyi
#18433 (comment)https://github.com/python/mypy/pull/18433#issuecomment-2585455830
error: Right operand of "or" is never evaluated - although it is evaluated at some point #14120 https://github.com/python/mypy/issues/14120
mypy thinks variable is None even if assigned non-None value inside loop #11900 https://github.com/python/mypy/issues/11900
False positive unreachable when variable is set and reset inside loop #14987 https://github.com/python/mypy/issues/14987
None-ness falsely assumed in loop #11430 https://github.com/python/mypy/issues/11430
https://github.com/grihabor
grihaborhttps://github.com/grihabor
Jan 23, 2025https://github.com/python/mypy/pull/18433#issuecomment-2609500293
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/tyralla
tyrallahttps://github.com/tyralla
Jan 23, 2025 https://github.com/python/mypy/pull/18433#ref-issue-2805571870
mypy duplicates reveal_type notes with partial types #18511 https://github.com/python/mypy/issues/18511
x612skmhttps://github.com/x612skm
Feb 24, 2025 https://github.com/python/mypy/pull/18433#ref-commit-548451d
https://github.com/tyralla
https://github.com/marketplace/pre-commit-ci
https://github.com/x612skm
Better names of and more compatibility between ad hoc intersections o…https://github.com/x612skm/mypy-dev/commit/548451d681c1cd0ac085078719d0f5aa6ebdda9f
548451dhttps://github.com/x612skm/mypy-dev/commit/548451d681c1cd0ac085078719d0f5aa6ebdda9f
python#18506https://github.com/python/mypy/pull/18506
python#18433https://github.com/python/mypy/pull/18433
python#18433 (comment)https://github.com/python/mypy/pull/18433#issuecomment-2583314142
@ilevkivskyihttps://github.com/ilevkivskyi
python#18433 (comment)https://github.com/python/mypy/pull/18433#issuecomment-2585455830
Bug with match.group().count in loop on v1.15.0 #18738 https://github.com/python/mypy/issues/18738
Mypy subclass/intersection issue on 1.15.0 #18912 https://github.com/python/mypy/issues/18912
https://github.com/JukkaL
JukkaLhttps://github.com/JukkaL
Apr 28, 2025 https://github.com/python/mypy/pull/18433#ref-issue-3025479653
Recent performance regressions #18991 https://github.com/python/mypy/issues/18991
https://github.com/tyralla
tyrallahttps://github.com/tyralla
May 30, 2025 https://github.com/python/mypy/pull/18433#ref-pullrequest-3075688529
Avoid false unreachable, redundant-expr, and redundant-casts warnings in loops more robustly and efficiently, and avoid multiple revealed type notes for the same line. #19118 https://github.com/python/mypy/pull/19118
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%2F18433
https://github.com/ilevkivskyi
ilevkivskyi https://github.com/ilevkivskyi
https://github.com/python/mypy/pull/18433/files/9b54ab1635a8a7e6d81ce7d304bf0e2a289a7704
https://github.com/hauntsaninja
hauntsaninja https://github.com/hauntsaninja
False positive with --warn-unreachable when an instance variable is modified inside a for loop https://github.com/python/mypy/issues/13973
(🐞) false narrowing with reassignment in loop https://github.com/python/mypy/issues/11612
False positive unreachable with redefined variable in loop https://github.com/python/mypy/issues/8865
Reachable code in loop marked unreachable https://github.com/python/mypy/issues/8721
--warn-unreachable false positive with minimal example without types explicitly set https://github.com/python/mypy/issues/7204
Binder fails to track loops correctly https://github.com/python/mypy/issues/18348
Please reload this pagehttps://github.com/python/mypy/pull/18433
https://github.com/tyralla
https://github.com/sterliakov
https://github.com/ilevkivskyi
https://github.com/hauntsaninja
https://github.com/grihabor
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.