PyType permits usage of two different types for one TypeVar for Sequance
Frang84 opened this issue · comments
Frang84 commented
Pytype permits one typeVar (T) for being a sequance of strings and sequance of integers.
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)
OUTPUT:
Success: no errors found
Rebecca Chen commented
Thanks for the report. I see that you've opened three issues for the same TypeVar problem with different container types, so I'm going to condense them down to one.