File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments