-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
lib.py:
from typing import Callable, TypeVar, Tuple
T = TypeVar('T')
R = TypeVar('R')
Transform = Callable[[T, int], Tuple[T, R]]main.py:
from typing import Tuple
from lib import Transform
def int_tf(m: int) -> Transform[int, str]: # Bad number of arguments for type alias, expected: 0, given: 2
def transform(i: int, pos: int) -> Tuple[int, str]:
a = (i + pos) % m # Name 'T' is not defined Name 'R' is not defined
return (a, 'ok')
return transformIt works when an alias is defined in the same file