Skip to content

Fix reachability for frozenset and dict view narrowing#21151

Merged
hauntsaninja merged 1 commit into
python:masterfrom
hauntsaninja:reachset
Apr 3, 2026
Merged

Fix reachability for frozenset and dict view narrowing#21151
hauntsaninja merged 1 commit into
python:masterfrom
hauntsaninja:reachset

Conversation

@hauntsaninja
Copy link
Copy Markdown
Collaborator

Fixes #21143 (on the same lines as #20704, i.e. there still exists a deeper fix that could be made)

I also update a comment that is a little out of date since #20863 and code in checkexpr.py that is out of date for modern typeshed

Fixes python#21143 (on the same lines as python#20704)

I also update a comment that is a little out of date since python#20863
and code in checkexpr.py that is out of date for modern typeshed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 2, 2026

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

@hauntsaninja hauntsaninja merged commit bdb0dd4 into python:master Apr 3, 2026
24 checks passed
@hauntsaninja hauntsaninja deleted the reachset branch April 3, 2026 20:00
hauntsaninja added a commit that referenced this pull request Apr 5, 2026
Fixes #21143 (on the same lines as #20704, i.e. there still exists a
deeper fix that could be made)

I also update a comment that is a little out of date since #20863 and
code in checkexpr.py that is out of date for modern typeshed
JukkaL pushed a commit that referenced this pull request Apr 28, 2026
This builds on the tech I added a few days ago in #21281. So we can also
get rid of frozenset special case from #21151. I believe we account for
all the dangerous_comparison logic now
JukkaL pushed a commit that referenced this pull request Apr 30, 2026
This builds on the tech I added a few days ago in #21281. So we can also
get rid of frozenset special case from #21151. I believe we account for
all the dangerous_comparison logic now
nicopauss pushed a commit to Intersec/lib-common that referenced this pull request Jun 4, 2026
##### [\`v1.20.1\`](https://github.com/python/mypy/blob/HEAD/CHANGELOG.md#Mypy-1201)

- Always disable sync in SQLite cache (Ivan Levkivskyi, PR [21184](python/mypy#21184))
- Temporarily skip few base64 tests (Ivan Levkivskyi, PR [21193](python/mypy#21193))
- Revert `dict.__or__` typeshed change (Ivan Levkivskyi, PR [21186](python/mypy#21186))
- Fix narrowing for match case with variadic tuples (Shantanu, PR [21192](python/mypy#21192))
- Avoid narrowing `type[T]` in type calls (Shantanu, PR [21174](python/mypy#21174))
- Fix regression for catching empty tuple in except (Shantanu, PR [21153](python/mypy#21153))
- Fix reachability for frozenset and dict view narrowing (Shantanu, PR [21151](python/mypy#21151))
- Fix narrowing with chained comparison (Shantanu, PR [21150](python/mypy#21150))
- Avoid narrowing to unreachable at module level (Shantanu, PR [21144](python/mypy#21144))
- Allow dangerous identity comparisons to `Any` typed variables (Shantanu, PR [21142](python/mypy#21142))
- `--warn-unused-config` should not be a strict flag (Ivan Levkivskyi, PR [21139](python/mypy#21139))
##### [\`v1.20.0\`](python/mypy@v1.19.1...v1.20.0)

Renovate-Branch: renovate/r2026-mypy-1.x
Change-Id: I88dbcfe5e6938c1401f9ffdda71a9a5e9703324a
Priv-Id: ac1477044856e83cc49e7b2b61d5068c572e0b50
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.

[1.20 regression] incorrect reachability for comparisons between set and frozenset

1 participant