{"action":"created","issue":{"url":"https://api.github.com/repos/python/mypy/issues/1188","repository_url":"https://api.github.com/repos/python/mypy","labels_url":"https://api.github.com/repos/python/mypy/issues/1188/labels{/name}","comments_url":"https://api.github.com/repos/python/mypy/issues/1188/comments","events_url":"https://api.github.com/repos/python/mypy/issues/1188/events","html_url":"https://github.com/python/mypy/issues/1188","id":129616102,"node_id":"MDU6SXNzdWUxMjk2MTYxMDI=","number":1188,"title":"Need a way to specify types for mock objects (e.g. mock.Mock())","user":{"login":"timabbott","id":2746074,"node_id":"MDQ6VXNlcjI3NDYwNzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/2746074?v=4","gravatar_id":"","url":"https://api.github.com/users/timabbott","html_url":"https://github.com/timabbott","followers_url":"https://api.github.com/users/timabbott/followers","following_url":"https://api.github.com/users/timabbott/following{/other_user}","gists_url":"https://api.github.com/users/timabbott/gists{/gist_id}","starred_url":"https://api.github.com/users/timabbott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timabbott/subscriptions","organizations_url":"https://api.github.com/users/timabbott/orgs","repos_url":"https://api.github.com/users/timabbott/repos","events_url":"https://api.github.com/users/timabbott/events{/privacy}","received_events_url":"https://api.github.com/users/timabbott/received_events","type":"User","site_admin":false},"labels":[{"id":936639327,"node_id":"MDU6TGFiZWw5MzY2MzkzMjc=","url":"https://api.github.com/repos/python/mypy/labels/false-positive","name":"false-positive","color":"fc2092","default":false},{"id":21488358,"node_id":"MDU6TGFiZWwyMTQ4ODM1OA==","url":"https://api.github.com/repos/python/mypy/labels/feature","name":"feature","color":"84b6eb","default":false},{"id":513232552,"node_id":"MDU6TGFiZWw1MTMyMzI1NTI=","url":"https://api.github.com/repos/python/mypy/labels/priority-1-normal","name":"priority-1-normal","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-01-28T23:24:41Z","updated_at":"2018-06-23T02:34:39Z","closed_at":null,"author_association":"NONE","body":"Example test case code here:\n\n```\nif True:\n    from pycurl import Curl, version_info\nelse:\n    from mock import Mock\n    Curl = Mock()\n    version_info = Mock()\n```\n\nPosting this in mypy, since I don't think it's possible to specify a typeshed type for mock.Mock that won't throw an error; e.g. if stubs say `mock.Mock` is an `Any`, you get `/home/tabbott/foo.py:7: error: Invalid assignment target`\n\nReporting as separate from #1152 since this might be worth solving even if that is not, since most every use of mock.Mock() will have this problem.\n"},"comment":{"url":"https://api.github.com/repos/python/mypy/issues/comments/399624136","html_url":"https://github.com/python/mypy/issues/1188#issuecomment-399624136","issue_url":"https://api.github.com/repos/python/mypy/issues/1188","id":399624136,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTYyNDEzNg==","user":{"login":"gvanrossum","id":2894642,"node_id":"MDQ6VXNlcjI4OTQ2NDI=","avatar_url":"https://avatars3.githubusercontent.com/u/2894642?v=4","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},"created_at":"2018-06-23T02:34:39Z","updated_at":"2018-06-23T02:34:39Z","author_association":"MEMBER","body":"What is \"PEP8 Type check\"?\r\n\r\nNote that we waffled a bit on this -- up till mypy 0.610 there was no typeshed definition for Mock. Then we added one, but we found it was too noisy, and we rolled it back, instead changing it so that we have `Mock: Any` in mock.pyi.\r\n\r\nSee also https://github.com/python/typing/issues/567. (Maybe this is the feature Tim was looking for?)"}}
{"actor":{"display_login":"gvanrossum"}}