google / pytype

A static type analyzer for Python code

Home Page:https://google.github.io/pytype

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyType permits usage of two different types for one TypeVar for Iterable

Frang84 opened this issue · comments

Pytype permits one typeVar (T) for being a iterable of strings and iterable of integers.

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)

OUTPUT:
Success: no errors found