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 87528ce commit 87617caCopy full SHA for 87617ca
1 file changed
test-data/unit/check-isinstance.test
@@ -1748,6 +1748,21 @@ def f(cls: Type[object]) -> None:
1748
cls()[0] + 1
1749
[builtins fixtures/isinstancelist.pyi]
1750
1751
+[case testIssubclassTypeVar]
1752
+# flags: --strict-equality --warn-unreachable
1753
+from __future__ import annotations
1754
+from typing import TypeVar
1755
+
1756
+ClassT = TypeVar("ClassT", bound=type)
1757
1758
+def directed_meet(cls0: ClassT, cls1: ClassT) -> ClassT | None:
1759
+ if issubclass(cls1, cls0):
1760
+ return cls1
1761
+ if issubclass(cls0, cls1):
1762
+ return cls0
1763
+ return None
1764
+[builtins fixtures/isinstancelist.pyi]
1765
1766
[case testIsinstanceTypeArgs]
1767
from typing import Iterable, TypeVar
1768
x = 1
0 commit comments