We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa01a07 commit 6115d9aCopy full SHA for 6115d9a
mypy/subtypes.py
@@ -1533,6 +1533,11 @@ def g(x: int) -> int: ...
1533
if right.is_type_obj() and not left.is_type_obj() and not allow_partial_overlap:
1534
return False
1535
1536
+ if left.is_type_obj():
1537
+ left_type_obj = left.type_object()
1538
+ if (left_type_obj.is_protocol or left_type_obj.is_abstract) and not right.is_type_obj():
1539
+ return False
1540
+
1541
# A callable L is a subtype of a generic callable R if L is a
1542
# subtype of every type obtained from R by substituting types for
1543
# the variables of R. We can check this by simply leaving the
0 commit comments