{"action":"created","issue":{"url":"https://api.github.com/repos/python/mypy/issues/3869","repository_url":"https://api.github.com/repos/python/mypy","labels_url":"https://api.github.com/repos/python/mypy/issues/3869/labels{/name}","comments_url":"https://api.github.com/repos/python/mypy/issues/3869/comments","events_url":"https://api.github.com/repos/python/mypy/issues/3869/events","html_url":"https://github.com/python/mypy/issues/3869","id":252702240,"number":3869,"title":"Missing annotation in function passed in a click decorator","user":{"login":"diamond-lizard","id":31175456,"avatar_url":"https://avatars3.githubusercontent.com/u/31175456?v=4","gravatar_id":"","url":"https://api.github.com/users/diamond-lizard","html_url":"https://github.com/diamond-lizard","followers_url":"https://api.github.com/users/diamond-lizard/followers","following_url":"https://api.github.com/users/diamond-lizard/following{/other_user}","gists_url":"https://api.github.com/users/diamond-lizard/gists{/gist_id}","starred_url":"https://api.github.com/users/diamond-lizard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diamond-lizard/subscriptions","organizations_url":"https://api.github.com/users/diamond-lizard/orgs","repos_url":"https://api.github.com/users/diamond-lizard/repos","events_url":"https://api.github.com/users/diamond-lizard/events{/privacy}","received_events_url":"https://api.github.com/users/diamond-lizard/received_events","type":"User","site_admin":false},"labels":[{"id":21488356,"url":"https://api.github.com/repos/python/mypy/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-24T19:15:02Z","updated_at":"2017-08-24T22:54:40Z","closed_at":null,"body":"When I run _\"mypy --disallow-any unannotated [foo.py](https://gist.github.com/diamond-lizard/033afc80c97b7cb84913176a259f2b37)\",_ mypy tells me that _\"[foo.py](https://gist.github.com/diamond-lizard/033afc80c97b7cb84913176a259f2b37):6: error: Function is missing a return type annotation\"_.\r\n\r\n[Here](https://gist.github.com/diamond-lizard/1bb89d6d80b387e1cfc452aa797f3814) is the output of running _\"mypy -v --disallow-any unannotated [foo.py](https://gist.github.com/diamond-lizard/033afc80c97b7cb84913176a259f2b37)\"_\r\n\r\nI'm not sure if this is a bug or if there's some special way I'm supposed to annotate the line mypy is complaining about."},"comment":{"url":"https://api.github.com/repos/python/mypy/issues/comments/324779172","html_url":"https://github.com/python/mypy/issues/3869#issuecomment-324779172","issue_url":"https://api.github.com/repos/python/mypy/issues/3869","id":324779172,"user":{"login":"ethanhs","id":9504279,"avatar_url":"https://avatars0.githubusercontent.com/u/9504279?v=4","gravatar_id":"","url":"https://api.github.com/users/ethanhs","html_url":"https://github.com/ethanhs","followers_url":"https://api.github.com/users/ethanhs/followers","following_url":"https://api.github.com/users/ethanhs/following{/other_user}","gists_url":"https://api.github.com/users/ethanhs/gists{/gist_id}","starred_url":"https://api.github.com/users/ethanhs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethanhs/subscriptions","organizations_url":"https://api.github.com/users/ethanhs/orgs","repos_url":"https://api.github.com/users/ethanhs/repos","events_url":"https://api.github.com/users/ethanhs/events{/privacy}","received_events_url":"https://api.github.com/users/ethanhs/received_events","type":"User","site_admin":false},"created_at":"2017-08-24T22:54:40Z","updated_at":"2017-08-24T22:54:40Z","body":"I believe we just increment the line number of the last decorator to find the function line number, which is not always accurate. We also cannot decrement from the first statement, as there may be a blank line between the nodes. Looking at the raw information of the ast parsing, I don't believe there is information on the line the annotation _should_ be if it is absent (since the attribute `returns` is `None`). This might require a change to typed_ast."}}
{"actor":{"display_login":"ethanhs"}}