Skip to content

Add a secret --check-unreachable - #21834

Merged
JukkaL merged 3 commits into
python:masterfrom
A5rocks:babys-first-unreachability-checking
Aug 12, 2026
Merged

Add a secret --check-unreachable#21834
JukkaL merged 3 commits into
python:masterfrom
A5rocks:babys-first-unreachability-checking

Conversation

@A5rocks

@A5rocks A5rocks commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Replaces #18707, references #21835.

This is very unbaked, but I figure it's best to get the smallest bit in. I'll see if I can figure out stacked PRs to add extra stuff to this (namely decreasing the number of false errors in unreachable code!), but this is probably super easy to review and a good start!

@A5rocks
A5rocks force-pushed the babys-first-unreachability-checking branch from 7b3e8de to 176415d Compare August 11, 2026 01:39
@A5rocks
A5rocks force-pushed the babys-first-unreachability-checking branch from 176415d to 2bce860 Compare August 11, 2026 01:41
@A5rocks

A5rocks commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

Nevermind, GitHub's stacked PRs is not good enough:

Stacked pull requests require all branches to be in the same repository. Cross-fork stacks are not supported.

:/ (or maybe I'm missing something. I was following https://docs.github.com/en/pull-requests/how-tos/create-pull-requests/creating-stacked-pull-requests#creating-a-stack-from-the-github-website and made A5rocks#1 but I can't seem to find a "Create stack" option...)

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@JukkaL JukkaL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! It makes sense to implement this incrementally, and when the feature works well enough, we can make it publicly available.

@JukkaL
JukkaL merged commit 6eb141f into python:master Aug 12, 2026
26 checks passed
@A5rocks
A5rocks deleted the babys-first-unreachability-checking branch August 12, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants