File tree Expand file tree Collapse file tree 2 files changed +0
-14
lines changed Expand file tree Collapse file tree 2 files changed +0
-14
lines changed Original file line number Diff line number Diff line change @@ -45,14 +45,6 @@ class A:
45
45
46
46
Contributed by Marc Mueller (PR [ 18641] ( https://github.com/python/mypy/pull/18641 ) )
47
47
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
-
56
48
## Mypy 1.15
57
49
58
50
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