You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from __future__ import annotations
from typing_extensions import TypeIs
class A: ...
class B: ...
def is_A(v: A | B) -> TypeIs[A]:
return xyz(v)
def main(a: A | B) -> None:
if is_A(a):
reveal_type(a)
else:
reveal_type(a)