The following code appends a str to a list of ints.
from typing import Iterable, List
def modify(l: Iterable[object]) -> None:
if isinstance(l, List[object]):
l.append("abc")
l = List[int]()
modify(l)
print(l) # ['abc']
1 + l[0] # TypeError: unsupported operand type(s) for +: 'int' and 'str'
(without mypy errors/warnings)
The following code appends a str to a list of ints.
(without mypy errors/warnings)