{"action":"created","issue":{"url":"https://api.github.com/repos/python/typing/issues/136","repository_url":"https://api.github.com/repos/python/typing","labels_url":"https://api.github.com/repos/python/typing/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/python/typing/issues/136/comments","events_url":"https://api.github.com/repos/python/typing/issues/136/events","html_url":"https://github.com/python/typing/issues/136","id":79502267,"number":136,"title":"Kill __subclasscheck__","user":{"login":"gvanrossum","id":2894642,"avatar_url":"https://avatars.githubusercontent.com/u/2894642?v=3","gravatar_id":"","url":"https://api.github.com/users/gvanrossum","html_url":"https://github.com/gvanrossum","followers_url":"https://api.github.com/users/gvanrossum/followers","following_url":"https://api.github.com/users/gvanrossum/following{/other_user}","gists_url":"https://api.github.com/users/gvanrossum/gists{/gist_id}","starred_url":"https://api.github.com/users/gvanrossum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gvanrossum/subscriptions","organizations_url":"https://api.github.com/users/gvanrossum/orgs","repos_url":"https://api.github.com/users/gvanrossum/repos","events_url":"https://api.github.com/users/gvanrossum/events{/privacy}","received_events_url":"https://api.github.com/users/gvanrossum/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/python/typing/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":33,"created_at":"2015-05-22T15:43:14Z","updated_at":"2016-05-06T07:24:31Z","closed_at":null,"body":"Mark Shannon wants me to drop `__subclasscheck__` from all type objects (Any, Union etc.). This is somewhat major surgery since it is used by Union simplification and for various type checks. See also #133 and #135."},"comment":{"url":"https://api.github.com/repos/python/typing/issues/comments/217369506","html_url":"https://github.com/python/typing/issues/136#issuecomment-217369506","issue_url":"https://api.github.com/repos/python/typing/issues/136","id":217369506,"user":{"login":"ilevkivskyi","id":12005495,"avatar_url":"https://avatars.githubusercontent.com/u/12005495?v=3","gravatar_id":"","url":"https://api.github.com/users/ilevkivskyi","html_url":"https://github.com/ilevkivskyi","followers_url":"https://api.github.com/users/ilevkivskyi/followers","following_url":"https://api.github.com/users/ilevkivskyi/following{/other_user}","gists_url":"https://api.github.com/users/ilevkivskyi/gists{/gist_id}","starred_url":"https://api.github.com/users/ilevkivskyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilevkivskyi/subscriptions","organizations_url":"https://api.github.com/users/ilevkivskyi/orgs","repos_url":"https://api.github.com/users/ilevkivskyi/repos","events_url":"https://api.github.com/users/ilevkivskyi/events{/privacy}","received_events_url":"https://api.github.com/users/ilevkivskyi/received_events","type":"User","site_admin":false},"created_at":"2016-05-06T07:24:31Z","updated_at":"2016-05-06T07:24:31Z","body":"First, and very important note: Clearly you are working with outdated version of `typing.py`. Many crucial bugs have been fixed since 3.5.1 and the whole generics system has been thoroughly reworked by @gvanrossum . If I have\r\n```python\r\nclass A(Generic[T]):\r\n    ...\r\nclass B(A[int]):\r\n    ...\r\n```\r\nthen with the last version at this github repo I get:\r\n```python\r\n>>> str(B)\r\n'__main__.B'\r\n\r\n>>> A[int]().__class__ is A\r\nTrue\r\n\r\n>>> B.__mro__\r\n(__main__.B, __main__.A<~T>[int], __main__.A<~T>, __main__.Generic<~T>, __main__.Generic, <class 'object'>) \r\n```\r\n\r\nNow, concerning the question about `issubclass`, as you can see there is an additional reason (apart from two mentioned in my previous post) for limiting it only to generics without parameters: Type erasure:\r\n```pyton\r\n>>> A[int]().__class__ is A\r\nTrue\r\n```\r\nIt is explained in the PEP lines 504-508 (again, the latest version of the PEP is always here, in this github repo. In case you didn't know, this PEP is still in the provisional status, i.e., it still could be edited).\r\n\r\nLet me explain why I want `TypeError` instead of `False`. Normally, `isinstance(1, Union)` would just return `False`, but we want to clearly say \"you are doing something completely wrong\", therefore we raise `TypeError`. The same situation is here, by raising `TypeError` we tell the user: If you are asking questions like `isinstance([], List[int])` you do not understand what is going on."}}