Skip to content

Commit 01877d7

Browse files
authored
[minor] Clean up optional in type map return type (#22254)
Authored by Codex
1 parent bb42acf commit 01877d7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎mypy/checker_shared.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def narrow_type_by_identity_equality(
260260
operand_types: list[Type],
261261
expr_indices: list[int],
262262
narrowable_indices: AbstractSet[int],
263-
) -> tuple[dict[Expression, Type] | None, dict[Expression, Type] | None]:
263+
) -> tuple[dict[Expression, Type], dict[Expression, Type]]:
264264
raise NotImplementedError
265265

266266
@abstractmethod

‎mypy/checkpattern.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ def visit_value_pattern(self, o: ValuePattern) -> PatternType:
211211
ok_map, rest_map = self.chk.narrow_type_by_identity_equality(
212212
"==", [node, TempNode(typ)], [current_type, typ], [0, 1], {0}
213213
)
214-
ok_type = ok_map.get(node, current_type) if ok_map is not None else UninhabitedType()
215-
rest_type = rest_map.get(node, current_type) if rest_map is not None else UninhabitedType()
214+
ok_type = ok_map.get(node, current_type)
215+
rest_type = rest_map.get(node, current_type)
216216
return PatternType(ok_type, rest_type, {})
217217

218218
def visit_singleton_pattern(self, o: SingletonPattern) -> PatternType:

0 commit comments

Comments
 (0)