Open
Description
The following code runs fine, but mypy produce an error:
from typing import List
class Foo(object):
def __init__(self):
self.version = [1, 2, 3]
def __getitem__(self, k):
return self.version[k]
def list_foo(f):
# type: (Foo) -> List[int]
return list(f)
print list_foo(Foo())
example.py: note: In function "list_foo":
example.py:13: error: No overload variant of "list" matches argument types [example.Foo]
Fail