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:
4545
4646Contributed 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
5850We’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:
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 )
You can’t perform that action at this time.
0 commit comments