{"action":"created","issue":{"url":"https://api.github.com/repos/JukkaL/mypy/issues/815","labels_url":"https://api.github.com/repos/JukkaL/mypy/issues/815/labels{/name}","comments_url":"https://api.github.com/repos/JukkaL/mypy/issues/815/comments","events_url":"https://api.github.com/repos/JukkaL/mypy/issues/815/events","html_url":"https://github.com/JukkaL/mypy/issues/815","id":101772699,"number":815,"title":"mypy confused by defaultdict(list)","user":{"login":"MichalPokorny","id":714892,"avatar_url":"https://avatars.githubusercontent.com/u/714892?v=3","gravatar_id":"","url":"https://api.github.com/users/MichalPokorny","html_url":"https://github.com/MichalPokorny","followers_url":"https://api.github.com/users/MichalPokorny/followers","following_url":"https://api.github.com/users/MichalPokorny/following{/other_user}","gists_url":"https://api.github.com/users/MichalPokorny/gists{/gist_id}","starred_url":"https://api.github.com/users/MichalPokorny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichalPokorny/subscriptions","organizations_url":"https://api.github.com/users/MichalPokorny/orgs","repos_url":"https://api.github.com/users/MichalPokorny/repos","events_url":"https://api.github.com/users/MichalPokorny/events{/privacy}","received_events_url":"https://api.github.com/users/MichalPokorny/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JukkaL/mypy/labels/hack","name":"hack","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-18T23:32:52Z","updated_at":"2015-08-23T23:25:01Z","closed_at":null,"body":"Source:\r\n```\r\nfrom collections import defaultdict\r\nx = defaultdict(list)\r\n```\r\n\r\nError:\r\n```\r\ntest.py:2: error: Argument 1 to \"defaultdict\" has incompatible type List[_T]; expected Callable[[], List[_T]]\r\ntest.py:2: error: Need type annotation for variable\r\n```"},"comment":{"url":"https://api.github.com/repos/JukkaL/mypy/issues/comments/133957891","html_url":"https://github.com/JukkaL/mypy/issues/815#issuecomment-133957891","issue_url":"https://api.github.com/repos/JukkaL/mypy/issues/815","id":133957891,"user":{"login":"JukkaL","id":1107911,"avatar_url":"https://avatars.githubusercontent.com/u/1107911?v=3","gravatar_id":"","url":"https://api.github.com/users/JukkaL","html_url":"https://github.com/JukkaL","followers_url":"https://api.github.com/users/JukkaL/followers","following_url":"https://api.github.com/users/JukkaL/following{/other_user}","gists_url":"https://api.github.com/users/JukkaL/gists{/gist_id}","starred_url":"https://api.github.com/users/JukkaL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JukkaL/subscriptions","organizations_url":"https://api.github.com/users/JukkaL/orgs","repos_url":"https://api.github.com/users/JukkaL/repos","events_url":"https://api.github.com/users/JukkaL/events{/privacy}","received_events_url":"https://api.github.com/users/JukkaL/received_events","type":"User","site_admin":false},"created_at":"2015-08-23T23:25:01Z","updated_at":"2015-08-23T23:25:01Z","body":"Also happens on master. Here is a self-contained repro suitable for a unit test:\r\n\r\n```\r\nfrom typing import Generic, Callable, TypeVar\r\n\r\nT = TypeVar('T')\r\n\r\nclass C(Generic[T]):\r\n    def __init__(self, x: Callable[[], T]) -> None: ...\r\n\r\nclass D(Generic[T]): pass\r\n\r\na = C(D)\r\nb = C(D) # type: C[D[str]]\r\n```"}}