Skip to content

Commit 7b11256

Browse files
committed
Fix own typing
1 parent 4fe7d9f commit 7b11256

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mypy/checker.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7692,10 +7692,12 @@ def get_isinstance_type(self, expr: Expression) -> list[TypeRange] | None:
76927692
for typ in all_types:
76937693
if isinstance(typ, FunctionLike) and typ.is_type_obj():
76947694
# If a type is generic, `isinstance` can only narrow its variables to Any.
7695-
erased_type = fill_typevars_with_any(typ.type_object())
7695+
any_parameterized = fill_typevars_with_any(typ.type_object())
76967696
# Tuples may have unattended type variables among their items
7697-
if isinstance(erased_type, TupleType):
7698-
erased_type = erase_typevars(erased_type)
7697+
if isinstance(any_parameterized, TupleType):
7698+
erased_type = erase_typevars(any_parameterized)
7699+
else:
7700+
erased_type = any_parameterized
76997701
types.append(TypeRange(erased_type, is_upper_bound=False))
77007702
elif isinstance(typ, TypeType):
77017703
# Type[A] means "any type that is a subtype of A" rather than "precisely type A"

0 commit comments

Comments
 (0)