Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from typing import TypeVar, Callable, Tuple, overload, Any
- T1 = TypeVar('T1')
- T2 = TypeVar('T2')
- T3 = TypeVar('T3')
- R = TypeVar('R')
- @overload
- def f(c: Callable[[T1], R], A: Tuple[T1]) -> R: ...
- @overload
- def f(c: Callable[[T1, T2], R], A: Tuple[T1, T2]) -> R: ...
- @overload
- def f(c: Callable[[T1, T2, T3], R], A: Tuple[T1, T2, T3]) -> R: ...
- def f(c, a):
- return c(*a)
- def t1(a: int) -> None:
- pass
- def t2(a: str, b: int) -> None:
- pass
- def t3(a: int, b: int) -> None:
- pass
- f(t1, ('2',))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement