Skip to content

Commit 94c063c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent f1371ae commit 94c063c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

mypy/checker.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8032,7 +8032,8 @@ def get_type_range_of_type(self, typ: Type) -> TypeRange | None:
80328032
return None
80338033
# Filter out None and UninhabitedType entries (type checkers need explicit None check)
80348034
valid_ranges = [
8035-
t for t in type_ranges
8035+
t
8036+
for t in type_ranges
80368037
if t is not None and not isinstance(get_proper_type(t.item), UninhabitedType)
80378038
]
80388039
if not valid_ranges:
@@ -8042,7 +8043,10 @@ def get_type_range_of_type(self, typ: Type) -> TypeRange | None:
80428043
# to avoid narrowing to a useless type.
80438044
item = make_simplified_union([t.item for t in valid_ranges])
80448045
proper_item = get_proper_type(item)
8045-
if isinstance(proper_item, Instance) and proper_item.type.fullname == "builtins.object":
8046+
if (
8047+
isinstance(proper_item, Instance)
8048+
and proper_item.type.fullname == "builtins.object"
8049+
):
80468050
return None
80478051
return TypeRange(item, is_upper_bound=True)
80488052
if isinstance(typ, FunctionLike) and typ.is_type_obj():

0 commit comments

Comments
 (0)