File tree 2 files changed +0
-12
lines changed 2 files changed +0
-12
lines changed Original file line number Diff line number Diff line change @@ -47,12 +47,6 @@ Contributed by Marc Mueller (PR [18641](https://github.com/python/mypy/pull/1864
47
47
48
48
### Other Notable Fixes and Improvements
49
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
-
56
50
## Mypy 1.15
57
51
58
52
We’ve just uploaded mypy 1.15 to the Python Package Index ([ PyPI] ( https://pypi.org/project/mypy/ ) ).
Original file line number Diff line number Diff line change @@ -5527,12 +5527,6 @@ def visit_match_stmt(self, s: MatchStmt) -> None:
5527
5527
pattern_map , else_map = conditional_types_to_typemaps (
5528
5528
named_subject , pattern_type .type , pattern_type .rest_type
5529
5529
)
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.
5536
5530
pattern_map = self .propagate_up_typemap_info (pattern_map )
5537
5531
else_map = self .propagate_up_typemap_info (else_map )
5538
5532
self .remove_capture_conflicts (pattern_type .captures , inferred_types )
You can’t perform that action at this time.
0 commit comments