Skip to content

Commit 419c936

Browse files
committed
Revert changes to the targeted fix
1 parent 3416461 commit 419c936

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

mypy/checker.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7072,6 +7072,8 @@ def refine_away_none_in_comparison(
70727072
non_optional_types = []
70737073
for i in chain_indices:
70747074
typ = operand_types[i]
7075+
if isinstance(get_proper_type(typ), AnyType):
7076+
continue
70757077
if not is_overlapping_none(typ):
70767078
non_optional_types.append(typ)
70777079

mypy/types_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def is_generic_instance(tp: Type) -> bool:
123123

124124
def is_overlapping_none(t: Type) -> bool:
125125
t = get_proper_type(t)
126-
return isinstance(t, (NoneType, AnyType)) or (
126+
return isinstance(t, NoneType) or (
127127
isinstance(t, UnionType) and any(isinstance(get_proper_type(e), NoneType) for e in t.items)
128128
)
129129

0 commit comments

Comments
 (0)