Skip to content

Commit 1a1dcb7

Browse files
committed
Fix typing
1 parent f37551d commit 1a1dcb7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mypy/subtypes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,12 +1091,12 @@ def visit_type_type(self, left: TypeType) -> bool:
10911091
right = self.right
10921092
if isinstance(right, TypeType):
10931093
return self._is_subtype(left.item, right.item)
1094-
if isinstance(right, (Overloaded, CallableType)):
1095-
if isinstance(right, Overloaded) and right.is_type_obj():
1096-
# Same as in other direction: if it's a constructor callable, all
1097-
# items should belong to the same class' constructor, so it's enough
1098-
# to check one of them.
1099-
right = right.items[0]
1094+
if isinstance(right, Overloaded) and right.is_type_obj():
1095+
# Same as in other direction: if it's a constructor callable, all
1096+
# items should belong to the same class' constructor, so it's enough
1097+
# to check one of them.
1098+
return self._is_subtype(left, right.items[0])
1099+
if isinstance(right, CallableType):
11001100
if self.proper_subtype and not right.is_type_obj():
11011101
# We can't accept `Type[X]` as a *proper* subtype of Callable[P, X]
11021102
# since this will break transitivity of subtyping.

0 commit comments

Comments
 (0)