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 fa84504 commit db44b6cCopy full SHA for db44b6c
test-data/unit/check-typeguard.test
@@ -754,6 +754,19 @@ if E()(x):
754
reveal_type(x) # N: Revealed type is "builtins.int"
755
[builtins fixtures/tuple.pyi]
756
757
+[case testNoCrashOnDunderCallTypeIsTemporaryObjectGeneric]
758
+from typing import Generic, TypeVar
759
+from typing_extensions import TypeIs
760
+T = TypeVar("T")
761
+class E(Generic[T]):
762
+ def __init__(self) -> None: ...
763
+ def __call__(self, o: object) -> TypeIs[T]:
764
+ return True
765
+x = object()
766
+if E[int]()(x):
767
+ reveal_type(x) # N: Revealed type is "builtins.int"
768
+[builtins fixtures/tuple.pyi]
769
+
770
[case testTypeGuardRestrictAwaySingleInvariant]
771
from typing import List
772
from typing_extensions import TypeGuard
0 commit comments