{"action":"created","issue":{"url":"https://api.github.com/repos/python/mypy/issues/3068","repository_url":"https://api.github.com/repos/python/mypy","labels_url":"https://api.github.com/repos/python/mypy/issues/3068/labels{/name}","comments_url":"https://api.github.com/repos/python/mypy/issues/3068/comments","events_url":"https://api.github.com/repos/python/mypy/issues/3068/events","html_url":"https://github.com/python/mypy/issues/3068","id":217374277,"number":3068,"title":"Regression: isinstance(x, AliasOfTuple) is not supported","user":{"login":"elazarg","id":5108069,"avatar_url":"https://avatars1.githubusercontent.com/u/5108069?v=3","gravatar_id":"","url":"https://api.github.com/users/elazarg","html_url":"https://github.com/elazarg","followers_url":"https://api.github.com/users/elazarg/followers","following_url":"https://api.github.com/users/elazarg/following{/other_user}","gists_url":"https://api.github.com/users/elazarg/gists{/gist_id}","starred_url":"https://api.github.com/users/elazarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elazarg/subscriptions","organizations_url":"https://api.github.com/users/elazarg/orgs","repos_url":"https://api.github.com/users/elazarg/repos","events_url":"https://api.github.com/users/elazarg/events{/privacy}","received_events_url":"https://api.github.com/users/elazarg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"JukkaL","id":1107911,"avatar_url":"https://avatars1.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},"assignees":[{"login":"JukkaL","id":1107911,"avatar_url":"https://avatars1.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}],"milestone":null,"comments":4,"created_at":"2017-03-27T21:02:08Z","updated_at":"2017-03-28T04:38:17Z","closed_at":null,"body":"Example:\r\n```Python\r\nT = (int, int)\r\nx : object\r\nif isinstance(x, T):\r\n    reveal_type(x)  # Revealed type is 'builtins.object'\r\n    x + x  # E: Unsupported left operand type for + (\"object\")\r\n```\r\n\r\nThis was introduced in #2995"},"comment":{"url":"https://api.github.com/repos/python/mypy/issues/comments/289660790","html_url":"https://github.com/python/mypy/issues/3068#issuecomment-289660790","issue_url":"https://api.github.com/repos/python/mypy/issues/3068","id":289660790,"user":{"login":"pkch","id":1593648,"avatar_url":"https://avatars1.githubusercontent.com/u/1593648?v=3","gravatar_id":"","url":"https://api.github.com/users/pkch","html_url":"https://github.com/pkch","followers_url":"https://api.github.com/users/pkch/followers","following_url":"https://api.github.com/users/pkch/following{/other_user}","gists_url":"https://api.github.com/users/pkch/gists{/gist_id}","starred_url":"https://api.github.com/users/pkch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkch/subscriptions","organizations_url":"https://api.github.com/users/pkch/orgs","repos_url":"https://api.github.com/users/pkch/repos","events_url":"https://api.github.com/users/pkch/events{/privacy}","received_events_url":"https://api.github.com/users/pkch/received_events","type":"User","site_admin":false},"created_at":"2017-03-28T04:38:17Z","updated_at":"2017-03-28T04:38:17Z","body":"Actually, I just realized that \"type concepts\" can also be used in `isinstance`, because this is valid (and useful):\r\n```\r\nx: Union[List[str], List[int]]\r\nif isinstance(x, List[str]): ...\r\n```\r\n\r\nGiven that, I don't see any problem with supporting more complicated type expressions, if it seems useful (including `isinstance(x, Union[A, B])` which isn't currently allowed)."}}
{"actor":{"display_login":"pkch"}}