{"action":"opened","issue":{"url":"https://api.github.com/repos/PyCQA/pylint/issues/2578","repository_url":"https://api.github.com/repos/PyCQA/pylint","labels_url":"https://api.github.com/repos/PyCQA/pylint/issues/2578/labels{/name}","comments_url":"https://api.github.com/repos/PyCQA/pylint/issues/2578/comments","events_url":"https://api.github.com/repos/PyCQA/pylint/issues/2578/events","html_url":"https://github.com/PyCQA/pylint/issues/2578","id":376410576,"node_id":"MDU6SXNzdWUzNzY0MTA1NzY=","number":2578,"title":"Type changes in decorators are not detected","user":{"login":"olirice","id":12958657,"node_id":"MDQ6VXNlcjEyOTU4NjU3","avatar_url":"https://avatars3.githubusercontent.com/u/12958657?v=4","gravatar_id":"","url":"https://api.github.com/users/olirice","html_url":"https://github.com/olirice","followers_url":"https://api.github.com/users/olirice/followers","following_url":"https://api.github.com/users/olirice/following{/other_user}","gists_url":"https://api.github.com/users/olirice/gists{/gist_id}","starred_url":"https://api.github.com/users/olirice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olirice/subscriptions","organizations_url":"https://api.github.com/users/olirice/orgs","repos_url":"https://api.github.com/users/olirice/repos","events_url":"https://api.github.com/users/olirice/events{/privacy}","received_events_url":"https://api.github.com/users/olirice/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-01T14:16:00Z","updated_at":"2018-11-01T14:16:00Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n  Hi there! Thank you for discovering and submitting an issue.\r\n\r\n  Before you submit this, make sure that the issue doesn't already exist\r\n  or if it is not closed.\r\n\r\n  Is your issue fixed on the preview release?: pip install pylint astroid --pre -U\r\n\r\n-->\r\nWhen a decorator changes the return type of a function, that change is not detected.\r\n\r\n### Steps to reproduce\r\n```python\r\nfrom typing import Callable\r\nfrom functools import wraps\r\n\r\ndef cast_to_str(func) -> Callable[..., str]:\r\n    @wraps(func)\r\n    def wrapper(*args, **kwargs):\r\n        return str(func(*args, **kwargs))\r\n    return wrapper\r\n\r\n@cast_to_str\r\ndef get_num() -> int:\r\n    return 5\r\n\r\nget_num().strip()\r\n# [no-member] Instance of 'int' has no 'strip' member \r\n```\r\n\r\n### Current behavior\r\nReturn type of decorated function is set by the function declaration\r\n\r\n### Expected behavior\r\nReturn type of the function set by decorator\r\n\r\n### pylint --version output\r\npylint 2.1.1\r\nastroid 2.0.4\r\nPython 3.6.5 (default, May 14 2018, 11:01:09) \r\n[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)]"}}
{"actor":{"display_login":"olirice"}}