{"action":"created","issue":{"url":"https://api.github.com/repos/python/typing/issues/250","repository_url":"https://api.github.com/repos/python/typing","labels_url":"https://api.github.com/repos/python/typing/issues/250/labels{/name}","comments_url":"https://api.github.com/repos/python/typing/issues/250/comments","events_url":"https://api.github.com/repos/python/typing/issues/250/events","html_url":"https://github.com/python/typing/issues/250","id":166630468,"number":250,"title":"Inheriting from instantiated generic class causes mocking to fail","user":{"login":"jhance","id":170192,"avatar_url":"https://avatars.githubusercontent.com/u/170192?v=3","gravatar_id":"","url":"https://api.github.com/users/jhance","html_url":"https://github.com/jhance","followers_url":"https://api.github.com/users/jhance/followers","following_url":"https://api.github.com/users/jhance/following{/other_user}","gists_url":"https://api.github.com/users/jhance/gists{/gist_id}","starred_url":"https://api.github.com/users/jhance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhance/subscriptions","organizations_url":"https://api.github.com/users/jhance/orgs","repos_url":"https://api.github.com/users/jhance/repos","events_url":"https://api.github.com/users/jhance/events{/privacy}","received_events_url":"https://api.github.com/users/jhance/received_events","type":"User","site_admin":false},"labels":[{"id":133486138,"url":"https://api.github.com/repos/python/typing/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/python/typing/milestones/3","html_url":"https://github.com/python/typing/milestones/3.5.3","labels_url":"https://api.github.com/repos/python/typing/milestones/3/labels","id":1965589,"number":3,"title":"3.5.3","description":"Whatever we want to make it into Python 3.5.3. (These things should also go into 3.6.0.)\r\n\r\nThere's no due date since [PEP 478](https://www.python.org/dev/peps/pep-0478/) doesn't have a date for 3.5.3 (most likely it's going to be December 2016).\r\n","creator":{"login":"gvanrossum","id":2894642,"avatar_url":"https://avatars.githubusercontent.com/u/2894642?v=3","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},"open_issues":2,"closed_issues":3,"state":"open","created_at":"2016-08-26T16:53:33Z","updated_at":"2016-10-24T20:17:15Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-07-20T16:55:39Z","updated_at":"2016-10-28T22:02:16Z","closed_at":"2016-10-21T02:58:12Z","body":"My reproduction (python 2)\r\n\r\n```\r\nimport mock\r\n\r\nfrom typing import Generic, TypeVar\r\n\r\nT = TypeVar('T')\r\n\r\nclass Bar(Generic[T]):\r\n    def __init__(self):\r\n        pass\r\n\r\n    def do_bar(self):\r\n        print(\"bar\")\r\n\r\nclass Foo(Bar[int]):\r\n    def do_foo(self):\r\n        self.do_bar()\r\n\r\n@mock.patch.object(Bar, 'do_bar')\r\ndef mocked(mock_do_bar):\r\n    mock_do_bar.return_value = None\r\n    foo = Foo()\r\n    foo.do_foo()\r\n\r\nmocked()\r\n```\r\n\r\nwill unexpectedly print `bar`.\r\n\r\nThe inheritance here is crucial."},"comment":{"url":"https://api.github.com/repos/python/typing/issues/comments/257039641","html_url":"https://github.com/python/typing/issues/250#issuecomment-257039641","issue_url":"https://api.github.com/repos/python/typing/issues/250","id":257039641,"user":{"login":"jhance","id":170192,"avatar_url":"https://avatars.githubusercontent.com/u/170192?v=3","gravatar_id":"","url":"https://api.github.com/users/jhance","html_url":"https://github.com/jhance","followers_url":"https://api.github.com/users/jhance/followers","following_url":"https://api.github.com/users/jhance/following{/other_user}","gists_url":"https://api.github.com/users/jhance/gists{/gist_id}","starred_url":"https://api.github.com/users/jhance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhance/subscriptions","organizations_url":"https://api.github.com/users/jhance/orgs","repos_url":"https://api.github.com/users/jhance/repos","events_url":"https://api.github.com/users/jhance/events{/privacy}","received_events_url":"https://api.github.com/users/jhance/received_events","type":"User","site_admin":false},"created_at":"2016-10-28T22:02:16Z","updated_at":"2016-10-28T22:02:16Z","body":"Thanks :D"}}
{"actor":{"display_login":"jhance"}}