Skip to content

Commit 9a6676b

Browse files
committed
Fix ruff SIM101: merge isinstance calls
1 parent e922a70 commit 9a6676b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

mypy/types_utils.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,8 @@ def is_generic_instance(tp: Type) -> bool:
123123

124124
def is_overlapping_none(t: Type) -> bool:
125125
t = get_proper_type(t)
126-
return (
127-
isinstance(t, NoneType)
128-
or isinstance(t, AnyType)
129-
or (
130-
isinstance(t, UnionType)
131-
and any(isinstance(get_proper_type(e), NoneType) for e in t.items)
132-
)
126+
return isinstance(t, (NoneType, AnyType)) or (
127+
isinstance(t, UnionType) and any(isinstance(get_proper_type(e), NoneType) for e in t.items)
133128
)
134129

135130

0 commit comments

Comments
 (0)