{"action":"closed","issue":{"url":"https://api.github.com/repos/python/typing/issues/79","repository_url":"https://api.github.com/repos/python/typing","labels_url":"https://api.github.com/repos/python/typing/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/python/typing/issues/79/comments","events_url":"https://api.github.com/repos/python/typing/issues/79/events","html_url":"https://github.com/python/typing/issues/79","id":67996876,"number":79,"title":"Type erasure and related issues","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":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/python/typing/milestones/1","html_url":"https://github.com/python/typing/milestones/3.5.2","labels_url":"https://api.github.com/repos/python/typing/milestones/1/labels","id":1654113,"number":1,"title":"3.5.2","description":"Things I want to address before CPython 3.5.2 is released. (But when is that? https://www.python.org/dev/peps/pep-0478/ has no schedule for it yet.)","creator":{"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},"open_issues":2,"closed_issues":10,"state":"open","created_at":"2016-03-18T18:20:10Z","updated_at":"2016-04-05T00:38:07Z","due_on":null,"closed_at":null},"comments":22,"created_at":"2015-04-13T03:31:29Z","updated_at":"2016-04-05T00:38:07Z","closed_at":"2016-04-05T00:38:07Z","body":"We said it shouldn't be possible to instantiate `List` or `List[t]` (i.e., `List()` or `List[t]()`), but the implementation allows this (where `t` can be a type variable or a concrete class). This should be disallowed (and made sure it's documented in the PEP).\r\n\r\nHowever, for user-defined generic classes it should definitely be possible to write node `Node()` and probably also `Node[t]()`. We must decide whether the latter is allowed, and if so whether the object it returns has `Node` or `Node[t]` as its `__class__`.\r\n\r\nAlso note that if the `Node` class is declared generic in a stub file, all uses of `Node[t]` must appear in string quotes (i.e. as forward references) since in this case the runtime `Node` class is not parametrized. (See https://github.com/ambv/typehinting/issues/60.)\r\n\r\nMark Shannon has proposed an intermediate option, using a class decorator like `@implements(Generic[T])`, which would make the fact that `Node` is parametrized knowable at runtime but without defining `isinstance()`, `issubclass()` or `Node[t]`. This would be a third way to do it, not replacing stubs or inheriting from `Generic[T]`. It could possibly also save space (since in CPython class objects such as created by `Node[t]` use a lot of memory).\r\n"}}