{"action":"created","issue":{"url":"https://api.github.com/repos/python/mypy/issues/2473","repository_url":"https://api.github.com/repos/python/mypy","labels_url":"https://api.github.com/repos/python/mypy/issues/2473/labels{/name}","comments_url":"https://api.github.com/repos/python/mypy/issues/2473/comments","events_url":"https://api.github.com/repos/python/mypy/issues/2473/events","html_url":"https://github.com/python/mypy/issues/2473","id":190852308,"number":2473,"title":"Cannot use `classmethod` as a base class","user":{"login":"Naddiseo","id":115951,"avatar_url":"https://avatars.githubusercontent.com/u/115951?v=3","gravatar_id":"","url":"https://api.github.com/users/Naddiseo","html_url":"https://github.com/Naddiseo","followers_url":"https://api.github.com/users/Naddiseo/followers","following_url":"https://api.github.com/users/Naddiseo/following{/other_user}","gists_url":"https://api.github.com/users/Naddiseo/gists{/gist_id}","starred_url":"https://api.github.com/users/Naddiseo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Naddiseo/subscriptions","organizations_url":"https://api.github.com/users/Naddiseo/orgs","repos_url":"https://api.github.com/users/Naddiseo/repos","events_url":"https://api.github.com/users/Naddiseo/events{/privacy}","received_events_url":"https://api.github.com/users/Naddiseo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-21T22:19:29Z","updated_at":"2017-01-16T11:52:02Z","closed_at":null,"body":"I'm not 100% sure this is a bug, but, currently, `classmethod` cannot be used as a base class. There is a real-world [use case in Django](https://github.com/django/django/blob/1.10.3/django/utils/decorators.py#L13-L17) which will give output similar to the following:\r\n\r\n> stubs/django/utils/decorators.pyi:9: error: Invalid type \"builtins.classmethod\"\r\nstubs/django/utils/decorators.pyi:9: error: Invalid base class\r\n\r\nIs there a better way for create a stub for that particular class?"},"comment":{"url":"https://api.github.com/repos/python/mypy/issues/comments/272842040","html_url":"https://github.com/python/mypy/issues/2473#issuecomment-272842040","issue_url":"https://api.github.com/repos/python/mypy/issues/2473","id":272842040,"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":"2017-01-16T11:52:02Z","updated_at":"2017-01-16T11:52:02Z","body":"Mypy treats `classmethod` as a special construct and thus it's pretty restricted what you can do with it. I'd suggest using aliasing (`classonlymethod = classmethod`) instead in a stub."}}
{"actor":{"display_login":"JukkaL"}}