Skip to content

Commit 0a6333a

Browse files
committed
Address review: drop changelog entry, remove comment
Signed-off-by: gopoto <[email protected]>
1 parent a9c40b8 commit 0a6333a

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

CHANGELOG.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@ class A:
4545

4646
Contributed by Marc Mueller (PR [18641](https://github.com/python/mypy/pull/18641))
4747

48-
### Other Notable Fixes and Improvements
49-
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-
5648
## Mypy 1.15
5749

5850
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)