{"action":"created","issue":{"url":"https://api.github.com/repos/python/mypy/issues/4140","repository_url":"https://api.github.com/repos/python/mypy","labels_url":"https://api.github.com/repos/python/mypy/issues/4140/labels{/name}","comments_url":"https://api.github.com/repos/python/mypy/issues/4140/comments","events_url":"https://api.github.com/repos/python/mypy/issues/4140/events","html_url":"https://github.com/python/mypy/issues/4140","id":267223368,"number":4140,"title":"'from .foo import *' introduces 'foo' as symbol that mypy doesn't recognise","user":{"login":"Wilfred","id":70800,"avatar_url":"https://avatars0.githubusercontent.com/u/70800?v=4","gravatar_id":"","url":"https://api.github.com/users/Wilfred","html_url":"https://github.com/Wilfred","followers_url":"https://api.github.com/users/Wilfred/followers","following_url":"https://api.github.com/users/Wilfred/following{/other_user}","gists_url":"https://api.github.com/users/Wilfred/gists{/gist_id}","starred_url":"https://api.github.com/users/Wilfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wilfred/subscriptions","organizations_url":"https://api.github.com/users/Wilfred/orgs","repos_url":"https://api.github.com/users/Wilfred/repos","events_url":"https://api.github.com/users/Wilfred/events{/privacy}","received_events_url":"https://api.github.com/users/Wilfred/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-10-20T15:59:20Z","updated_at":"2017-10-27T12:32:16Z","closed_at":null,"author_association":"NONE","body":"The typeshed definition for `yaml/__init__.pyi` contains the following ([src](https://github.com/python/typeshed/blob/master/third_party/2and3/yaml/__init__.pyi#L2)):\r\n\r\n```python\r\nfrom yaml.error import *\r\n```\r\n\r\nThis has two side effects: it adds every symbol `foo` in `yaml/error.py` as `yaml.foo`. However, it also defines `yaml.error`.\r\n\r\nI believe this is why the mypy complains about the following correct code:\r\n\r\n```python\r\nimport yaml\r\n\r\ndef foo():\r\n    # type: () -> None\r\n    yaml.error\r\n```\r\n\r\n```\r\n$ mypy --py2 foo.py\r\nfoo.py:5: error: Module has no attribute \"error\"\r\n```\r\n\r\nOddly, I can't reproduce this on Python 3. The following code does not produce a type error:\r\n\r\n```python\r\nimport yaml\r\n\r\ndef foo() -> None:\r\n    yaml.error\r\n```"},"comment":{"url":"https://api.github.com/repos/python/mypy/issues/comments/339958407","html_url":"https://github.com/python/mypy/issues/4140#issuecomment-339958407","issue_url":"https://api.github.com/repos/python/mypy/issues/4140","id":339958407,"user":{"login":"Wilfred","id":70800,"avatar_url":"https://avatars0.githubusercontent.com/u/70800?v=4","gravatar_id":"","url":"https://api.github.com/users/Wilfred","html_url":"https://github.com/Wilfred","followers_url":"https://api.github.com/users/Wilfred/followers","following_url":"https://api.github.com/users/Wilfred/following{/other_user}","gists_url":"https://api.github.com/users/Wilfred/gists{/gist_id}","starred_url":"https://api.github.com/users/Wilfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wilfred/subscriptions","organizations_url":"https://api.github.com/users/Wilfred/orgs","repos_url":"https://api.github.com/users/Wilfred/repos","events_url":"https://api.github.com/users/Wilfred/events{/privacy}","received_events_url":"https://api.github.com/users/Wilfred/received_events","type":"User","site_admin":false},"created_at":"2017-10-27T12:32:16Z","updated_at":"2017-10-27T12:32:16Z","author_association":"NONE","body":"This rather looks like it's using a copy of typeshed from inside mypy itself. Are there any other tests you'd like me to run?"}}
{"actor":{"display_login":"Wilfred"}}