Skip to content

Commit 6d03c52

Browse files
committed
Address review: drop changelog entry, remove comment
Signed-off-by: gopoto <201852096+gopoto@users.noreply.github.com>
1 parent a9c40b8 commit 6d03c52

File tree

2 files changed

+0
-12
lines changed

2 files changed

+0
-12
lines changed

CHANGELOG.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ Contributed by Marc Mueller (PR [18641](https://github.com/python/mypy/pull/1864
4747

4848
### Other Notable Fixes and Improvements
4949

50-
* Pattern matching on discriminant attributes and keys in union types
51-
(such as `tag` fields in `TypedDict`s or classes) now correctly narrows
52-
the subject type within each `case` block. Previously, mypy would fail
53-
to narrow the parent type when matching on expressions like `match d["tag"]`
54-
or `match d.tag`. This fixes issue [#16286](https://github.com/python/mypy/issues/16286).
55-
5650
## Mypy 1.15
5751

5852
We’ve just uploaded mypy 1.15 to the Python Package Index ([PyPI](https://pypi.org/project/mypy/)).

mypy/checker.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5527,12 +5527,6 @@ def visit_match_stmt(self, s: MatchStmt) -> None:
55275527
pattern_map, else_map = conditional_types_to_typemaps(
55285528
named_subject, pattern_type.type, pattern_type.rest_type
55295529
)
5530-
# Also refine the parent expression of the subject.
5531-
# For example, if the subject is an index or attribute expression like
5532-
# ``d["key"]`` or ``d.attr``, propagate any narrowing information about
5533-
# the subject back up to ``d`` (and recursively, to further parents).
5534-
# This mirrors the behavior of our conditional (``if``) binder,
5535-
# which calls ``propagate_up_typemap_info`` when handling comparisons.
55365530
pattern_map = self.propagate_up_typemap_info(pattern_map)
55375531
else_map = self.propagate_up_typemap_info(else_map)
55385532
self.remove_capture_conflicts(pattern_type.captures, inferred_types)

0 commit comments

Comments
 (0)