-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
tyMulti-file analysis & type inferenceMulti-file analysis & type inference
Description
What about intersection types?
def _(
c: Intersection[Callable[[Union[int, str]], int], A],
d: Intersection[A, Callable[[Union[int, str]], int]],
e: Intersection[A, Callable[[Union[int, str]], int], B],
f: Intersection[Not[Callable[[int, str], Intersection[int, str]]]]
):
reveal_type(c) # revealed: ((int | str, /) -> int) & A
reveal_type(d) # revealed: A & ((int | str, /) -> int)
reveal_type(e) # revealed: A & ((int | str, /) -> int) & B
reveal_type(f) # revealed: ~((int, str, /) -> int & str)Originally posted by @InSyncWithFoo in #16907 (comment)
Same as #16893 but for intersections
Metadata
Metadata
Assignees
Labels
tyMulti-file analysis & type inferenceMulti-file analysis & type inference