{"action":"created","comment":{"url":"https://api.github.com/repos/numpy/numpy/pulls/comments/232469101","pull_request_review_id":173678512,"id":232469101,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjQ2OTEwMQ==","diff_hunk":"@@ -1499,6 +1500,59 @@ def test_size_zero_output(self):\n         with assert_raises_regex(ValueError, 'new output dimensions'):\n             f(x)\n \n+    @pytest.mark.skipif(not HAS_REFCOUNT, reason=\"Python lacks refcounts\")\n+    def test_frompyfunc_leaks(self):\n+        # exposed in gh-11867 as np.vectorized, but the problem stems from\n+        # frompyfunc.\n+        # class.attribute = np.frompyfunc(<method>) creates a\n+        # reference cycle that requires a gc collection cycle to break\n+        # (on CPython 3)\n+        import gc\n+        gc.disable()\n+        iters = 20\n+        try:\n+            class A(object):\n+                def method(self, *args):\n+                    return 0\n+\n+                @classmethod\n+                def method1(*args):","path":"numpy/lib/tests/test_function_base.py","position":28,"original_position":28,"commit_id":"0794da8d5befc4274fbc2fd8d59c202a8fb28702","original_commit_id":"0794da8d5befc4274fbc2fd8d59c202a8fb28702","user":{"login":"mattip","id":823911,"node_id":"MDQ6VXNlcjgyMzkxMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/823911?v=4","gravatar_id":"","url":"https://api.github.com/users/mattip","html_url":"https://github.com/mattip","followers_url":"https://api.github.com/users/mattip/followers","following_url":"https://api.github.com/users/mattip/following{/other_user}","gists_url":"https://api.github.com/users/mattip/gists{/gist_id}","starred_url":"https://api.github.com/users/mattip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattip/subscriptions","organizations_url":"https://api.github.com/users/mattip/orgs","repos_url":"https://api.github.com/users/mattip/repos","events_url":"https://api.github.com/users/mattip/events{/privacy}","received_events_url":"https://api.github.com/users/mattip/received_events","type":"User","site_admin":false},"body":"changed to `@staticmethod`","created_at":"2018-11-10T23:10:12Z","updated_at":"2018-11-10T23:10:12Z","html_url":"https://github.com/numpy/numpy/pull/11977#discussion_r232469101","pull_request_url":"https://api.github.com/repos/numpy/numpy/pulls/11977","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/numpy/numpy/pulls/comments/232469101"},"html":{"href":"https://github.com/numpy/numpy/pull/11977#discussion_r232469101"},"pull_request":{"href":"https://api.github.com/repos/numpy/numpy/pulls/11977"}},"in_reply_to_id":232468336},"pull_request":{"url":"https://api.github.com/repos/numpy/numpy/pulls/11977","id":216211728,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2MjExNzI4","html_url":"https://github.com/numpy/numpy/pull/11977","diff_url":"https://github.com/numpy/numpy/pull/11977.diff","patch_url":"https://github.com/numpy/numpy/pull/11977.patch","issue_url":"https://api.github.com/repos/numpy/numpy/issues/11977","number":11977,"state":"open","locked":false,"title":"BUG: reference cycle in np.vectorize","user":{"login":"mattip","id":823911,"node_id":"MDQ6VXNlcjgyMzkxMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/823911?v=4","gravatar_id":"","url":"https://api.github.com/users/mattip","html_url":"https://github.com/mattip","followers_url":"https://api.github.com/users/mattip/followers","following_url":"https://api.github.com/users/mattip/following{/other_user}","gists_url":"https://api.github.com/users/mattip/gists{/gist_id}","starred_url":"https://api.github.com/users/mattip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattip/subscriptions","organizations_url":"https://api.github.com/users/mattip/orgs","repos_url":"https://api.github.com/users/mattip/repos","events_url":"https://api.github.com/users/mattip/events{/privacy}","received_events_url":"https://api.github.com/users/mattip/received_events","type":"User","site_admin":false},"body":"Issue #11867 demonstrated a leak when using `np.vectorize` on a bound class method in CPython 3. The test demonstrates the issue.\r\n\r\n~Still WIP since I have not found the root cause of the leak.~\r\n\r\nEdit: adding GC_Track to ufunc allows the garbage collector to break the cycle","created_at":"2018-09-18T07:43:23Z","updated_at":"2018-11-10T23:10:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ad1de0a6d4951ca50da598043337fd8b6fcfc04","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":6359214,"node_id":"MDU6TGFiZWw2MzU5MjE0","url":"https://api.github.com/repos/numpy/numpy/labels/00%20-%20Bug","name":"00 - Bug","color":"fef2c0","default":false},{"id":959099844,"node_id":"MDU6TGFiZWw5NTkwOTk4NDQ=","url":"https://api.github.com/repos/numpy/numpy/labels/component:%20numpy.ufunc","name":"component: numpy.ufunc","color":"009800","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/numpy/numpy/pulls/11977/commits","review_comments_url":"https://api.github.com/repos/numpy/numpy/pulls/11977/comments","review_comment_url":"https://api.github.com/repos/numpy/numpy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/11977/comments","statuses_url":"https://api.github.com/repos/numpy/numpy/statuses/0794da8d5befc4274fbc2fd8d59c202a8fb28702","head":{"label":"mattip:vectorize-refcount","ref":"vectorize-refcount","sha":"0794da8d5befc4274fbc2fd8d59c202a8fb28702","user":{"login":"mattip","id":823911,"node_id":"MDQ6VXNlcjgyMzkxMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/823911?v=4","gravatar_id":"","url":"https://api.github.com/users/mattip","html_url":"https://github.com/mattip","followers_url":"https://api.github.com/users/mattip/followers","following_url":"https://api.github.com/users/mattip/following{/other_user}","gists_url":"https://api.github.com/users/mattip/gists{/gist_id}","starred_url":"https://api.github.com/users/mattip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattip/subscriptions","organizations_url":"https://api.github.com/users/mattip/orgs","repos_url":"https://api.github.com/users/mattip/repos","events_url":"https://api.github.com/users/mattip/events{/privacy}","received_events_url":"https://api.github.com/users/mattip/received_events","type":"User","site_admin":false},"repo":{"id":101918527,"node_id":"MDEwOlJlcG9zaXRvcnkxMDE5MTg1Mjc=","name":"numpy","full_name":"mattip/numpy","private":false,"owner":{"login":"mattip","id":823911,"node_id":"MDQ6VXNlcjgyMzkxMQ==","avatar_url":"https://avatars0.githubusercontent.com/u/823911?v=4","gravatar_id":"","url":"https://api.github.com/users/mattip","html_url":"https://github.com/mattip","followers_url":"https://api.github.com/users/mattip/followers","following_url":"https://api.github.com/users/mattip/following{/other_user}","gists_url":"https://api.github.com/users/mattip/gists{/gist_id}","starred_url":"https://api.github.com/users/mattip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattip/subscriptions","organizations_url":"https://api.github.com/users/mattip/orgs","repos_url":"https://api.github.com/users/mattip/repos","events_url":"https://api.github.com/users/mattip/events{/privacy}","received_events_url":"https://api.github.com/users/mattip/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mattip/numpy","description":"Numpy main repository","fork":true,"url":"https://api.github.com/repos/mattip/numpy","forks_url":"https://api.github.com/repos/mattip/numpy/forks","keys_url":"https://api.github.com/repos/mattip/numpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattip/numpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattip/numpy/teams","hooks_url":"https://api.github.com/repos/mattip/numpy/hooks","issue_events_url":"https://api.github.com/repos/mattip/numpy/issues/events{/number}","events_url":"https://api.github.com/repos/mattip/numpy/events","assignees_url":"https://api.github.com/repos/mattip/numpy/assignees{/user}","branches_url":"https://api.github.com/repos/mattip/numpy/branches{/branch}","tags_url":"https://api.github.com/repos/mattip/numpy/tags","blobs_url":"https://api.github.com/repos/mattip/numpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattip/numpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattip/numpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattip/numpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattip/numpy/statuses/{sha}","languages_url":"https://api.github.com/repos/mattip/numpy/languages","stargazers_url":"https://api.github.com/repos/mattip/numpy/stargazers","contributors_url":"https://api.github.com/repos/mattip/numpy/contributors","subscribers_url":"https://api.github.com/repos/mattip/numpy/subscribers","subscription_url":"https://api.github.com/repos/mattip/numpy/subscription","commits_url":"https://api.github.com/repos/mattip/numpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattip/numpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattip/numpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattip/numpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattip/numpy/contents/{+path}","compare_url":"https://api.github.com/repos/mattip/numpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattip/numpy/merges","archive_url":"https://api.github.com/repos/mattip/numpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattip/numpy/downloads","issues_url":"https://api.github.com/repos/mattip/numpy/issues{/number}","pulls_url":"https://api.github.com/repos/mattip/numpy/pulls{/number}","milestones_url":"https://api.github.com/repos/mattip/numpy/milestones{/number}","notifications_url":"https://api.github.com/repos/mattip/numpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattip/numpy/labels{/name}","releases_url":"https://api.github.com/repos/mattip/numpy/releases{/id}","deployments_url":"https://api.github.com/repos/mattip/numpy/deployments","created_at":"2017-08-30T19:01:59Z","updated_at":"2018-11-01T06:38:53Z","pushed_at":"2018-11-10T15:55:18Z","git_url":"git://github.com/mattip/numpy.git","ssh_url":"git@github.com:mattip/numpy.git","clone_url":"https://github.com/mattip/numpy.git","svn_url":"https://github.com/mattip/numpy","homepage":"http://www.numpy.org/","size":60813,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"numpy:master","ref":"master","sha":"072c90ea848c753b7e8b7c42d2e359f53dfd0085","user":{"login":"numpy","id":288276,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4ODI3Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/288276?v=4","gravatar_id":"","url":"https://api.github.com/users/numpy","html_url":"https://github.com/numpy","followers_url":"https://api.github.com/users/numpy/followers","following_url":"https://api.github.com/users/numpy/following{/other_user}","gists_url":"https://api.github.com/users/numpy/gists{/gist_id}","starred_url":"https://api.github.com/users/numpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numpy/subscriptions","organizations_url":"https://api.github.com/users/numpy/orgs","repos_url":"https://api.github.com/users/numpy/repos","events_url":"https://api.github.com/users/numpy/events{/privacy}","received_events_url":"https://api.github.com/users/numpy/received_events","type":"Organization","site_admin":false},"repo":{"id":908607,"node_id":"MDEwOlJlcG9zaXRvcnk5MDg2MDc=","name":"numpy","full_name":"numpy/numpy","private":false,"owner":{"login":"numpy","id":288276,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4ODI3Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/288276?v=4","gravatar_id":"","url":"https://api.github.com/users/numpy","html_url":"https://github.com/numpy","followers_url":"https://api.github.com/users/numpy/followers","following_url":"https://api.github.com/users/numpy/following{/other_user}","gists_url":"https://api.github.com/users/numpy/gists{/gist_id}","starred_url":"https://api.github.com/users/numpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numpy/subscriptions","organizations_url":"https://api.github.com/users/numpy/orgs","repos_url":"https://api.github.com/users/numpy/repos","events_url":"https://api.github.com/users/numpy/events{/privacy}","received_events_url":"https://api.github.com/users/numpy/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/numpy/numpy","description":"Numpy main repository","fork":false,"url":"https://api.github.com/repos/numpy/numpy","forks_url":"https://api.github.com/repos/numpy/numpy/forks","keys_url":"https://api.github.com/repos/numpy/numpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/numpy/numpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/numpy/numpy/teams","hooks_url":"https://api.github.com/repos/numpy/numpy/hooks","issue_events_url":"https://api.github.com/repos/numpy/numpy/issues/events{/number}","events_url":"https://api.github.com/repos/numpy/numpy/events","assignees_url":"https://api.github.com/repos/numpy/numpy/assignees{/user}","branches_url":"https://api.github.com/repos/numpy/numpy/branches{/branch}","tags_url":"https://api.github.com/repos/numpy/numpy/tags","blobs_url":"https://api.github.com/repos/numpy/numpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/numpy/numpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/numpy/numpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/numpy/numpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/numpy/numpy/statuses/{sha}","languages_url":"https://api.github.com/repos/numpy/numpy/languages","stargazers_url":"https://api.github.com/repos/numpy/numpy/stargazers","contributors_url":"https://api.github.com/repos/numpy/numpy/contributors","subscribers_url":"https://api.github.com/repos/numpy/numpy/subscribers","subscription_url":"https://api.github.com/repos/numpy/numpy/subscription","commits_url":"https://api.github.com/repos/numpy/numpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/numpy/numpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/numpy/numpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/numpy/numpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/numpy/numpy/contents/{+path}","compare_url":"https://api.github.com/repos/numpy/numpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/numpy/numpy/merges","archive_url":"https://api.github.com/repos/numpy/numpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/numpy/numpy/downloads","issues_url":"https://api.github.com/repos/numpy/numpy/issues{/number}","pulls_url":"https://api.github.com/repos/numpy/numpy/pulls{/number}","milestones_url":"https://api.github.com/repos/numpy/numpy/milestones{/number}","notifications_url":"https://api.github.com/repos/numpy/numpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/numpy/numpy/labels{/name}","releases_url":"https://api.github.com/repos/numpy/numpy/releases{/id}","deployments_url":"https://api.github.com/repos/numpy/numpy/deployments","created_at":"2010-09-13T23:02:39Z","updated_at":"2018-11-10T23:05:00Z","pushed_at":"2018-11-10T23:04:10Z","git_url":"git://github.com/numpy/numpy.git","ssh_url":"git@github.com:numpy/numpy.git","clone_url":"https://github.com/numpy/numpy.git","svn_url":"https://github.com/numpy/numpy","homepage":"https://www.numpy.org/","size":62107,"stargazers_count":8650,"watchers_count":8650,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3115,"mirror_url":null,"archived":false,"open_issues_count":2029,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":3115,"open_issues":2029,"watchers":8650,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/numpy/numpy/pulls/11977"},"html":{"href":"https://github.com/numpy/numpy/pull/11977"},"issue":{"href":"https://api.github.com/repos/numpy/numpy/issues/11977"},"comments":{"href":"https://api.github.com/repos/numpy/numpy/issues/11977/comments"},"review_comments":{"href":"https://api.github.com/repos/numpy/numpy/pulls/11977/comments"},"review_comment":{"href":"https://api.github.com/repos/numpy/numpy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/numpy/numpy/pulls/11977/commits"},"statuses":{"href":"https://api.github.com/repos/numpy/numpy/statuses/0794da8d5befc4274fbc2fd8d59c202a8fb28702"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mattip"}}