{"action":"created","issue":{"url":"https://api.github.com/repos/JukkaL/mypy/issues/949","labels_url":"https://api.github.com/repos/JukkaL/mypy/issues/949/labels{/name}","comments_url":"https://api.github.com/repos/JukkaL/mypy/issues/949/comments","events_url":"https://api.github.com/repos/JukkaL/mypy/issues/949/events","html_url":"https://github.com/JukkaL/mypy/issues/949","id":111987605,"number":949,"title":"Unable to use `isinstance` with generic type","user":{"login":"jhance","id":170192,"avatar_url":"https://avatars.githubusercontent.com/u/170192?v=3","gravatar_id":"","url":"https://api.github.com/users/jhance","html_url":"https://github.com/jhance","followers_url":"https://api.github.com/users/jhance/followers","following_url":"https://api.github.com/users/jhance/following{/other_user}","gists_url":"https://api.github.com/users/jhance/gists{/gist_id}","starred_url":"https://api.github.com/users/jhance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhance/subscriptions","organizations_url":"https://api.github.com/users/jhance/orgs","repos_url":"https://api.github.com/users/jhance/repos","events_url":"https://api.github.com/users/jhance/events{/privacy}","received_events_url":"https://api.github.com/users/jhance/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JukkaL/mypy/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-17T22:10:25Z","updated_at":"2015-10-18T20:06:49Z","closed_at":null,"body":"For example\r\n```\r\nclass A(Generic[T]):\r\n   pass\r\n\r\nclass B(Generic[T], A[T]):\r\n   pass\r\n\r\ndef f(x: A[T]):\r\n    if isinstance(x, B[T]):\r\n        ...\r\n```\r\nis apparently illegal and I'm not sure what replacement I'm supposed to use. It tells me to use a `# type` comment which isn't really applicable here.\r\n\r\nRemoving the `[T]` causes mypy to be unable to infer that `x` is in fact a `B[T]`."},"comment":{"url":"https://api.github.com/repos/JukkaL/mypy/issues/comments/149042648","html_url":"https://github.com/JukkaL/mypy/issues/949#issuecomment-149042648","issue_url":"https://api.github.com/repos/JukkaL/mypy/issues/949","id":149042648,"user":{"login":"jhance","id":170192,"avatar_url":"https://avatars.githubusercontent.com/u/170192?v=3","gravatar_id":"","url":"https://api.github.com/users/jhance","html_url":"https://github.com/jhance","followers_url":"https://api.github.com/users/jhance/followers","following_url":"https://api.github.com/users/jhance/following{/other_user}","gists_url":"https://api.github.com/users/jhance/gists{/gist_id}","starred_url":"https://api.github.com/users/jhance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhance/subscriptions","organizations_url":"https://api.github.com/users/jhance/orgs","repos_url":"https://api.github.com/users/jhance/repos","events_url":"https://api.github.com/users/jhance/events{/privacy}","received_events_url":"https://api.github.com/users/jhance/received_events","type":"User","site_admin":false},"created_at":"2015-10-18T20:06:49Z","updated_at":"2015-10-18T20:06:49Z","body":"I don't think that is powerful enough.\r\n\r\nWhat if I have an `A[U,V]` and want to know if its an `A[U,U]`?"}}