Open Frang84 opened 10 months ago
Also happens with Sequence and Iterable:
T = TypeVar("T")
def functionTab(first: T, second: T) -> T :
resultList = []
for i in first:
resultList.append(i)
for i in second:
resultList.append(i)
return resultList
list1 : Sequence[str] = ["dog", "cat"]
list2 : Sequence[int] = [1,2,3]
functionTab(list1, list2)
def functionTab(first: T, second: T) -> T :
resultList = []
for i in first:
resultList.append(i)
for i in second:
resultList.append(i)
return resultList
list1 : Iterable[int] = [1,2,3]
list2 : Iterable[str] = ["dog", "cat"]
functionTab(list1, list2)
Pytype permits one typeVar (T) for being a list of strings and list of integers.
OUTPUT: Success: no errors found